diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-01-08 22:39:25 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-01-08 23:26:49 +0100 |
commit | 606aa3baee1e85626f289b0864963e4c920eff8b (patch) | |
tree | 767256635f3935ba471c68b429bc8998303ea322 | |
parent | 36dac6da41c8a28e03d33bfb839040156d5d6804 (diff) | |
download | ffmpeg-606aa3baee1e85626f289b0864963e4c920eff8b.tar.gz |
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
0072116.
Fixes #2124.
(cherry picked from commit 119d70db5099f9513d954283245efd7f699ad321)
-rw-r--r-- | libavformat/mux.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c index c7e176abb3..c34a2946c7 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -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) { - int ret; - AVPacket spkt = *pkt; + int ret, did_split; - av_packet_split_side_data(&spkt); - ret = s->oformat->write_packet(s, &spkt); - spkt.data = NULL; - av_destruct_packet(&spkt); + did_split = av_packet_split_side_data(pkt); + ret = s->oformat->write_packet(s, pkt); + if (did_split) + av_packet_merge_side_data(pkt); return ret; } |