Commit 119d70db authored by Clément Bœsch's avatar Clément Bœsch

lavf/mux: do not pass a copy of the packet to write_packet().

Sometimes the muxer modifies the packet, like for instance lavf/mp3enc
changing pkt->destruct in order to keep a copy. These changes must be
kept, even though the muxer behaviour is questionable. Regression since
0072116c.

Fixes #2124.
parent a260c797
...@@ -490,13 +490,12 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt) ...@@ -490,13 +490,12 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
*/ */
static inline int split_write_packet(AVFormatContext *s, AVPacket *pkt) static inline int split_write_packet(AVFormatContext *s, AVPacket *pkt)
{ {
int ret; int ret, did_split;
AVPacket spkt = *pkt;
av_packet_split_side_data(&spkt); did_split = av_packet_split_side_data(pkt);
ret = s->oformat->write_packet(s, &spkt); ret = s->oformat->write_packet(s, pkt);
spkt.data = NULL; if (did_split)
av_destruct_packet(&spkt); av_packet_merge_side_data(pkt);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment