avformat/segment: re-interleave packets if needed
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 24 Jul 2014 21:22:33 +0000 (23:22 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 24 Jul 2014 21:22:33 +0000 (23:22 +0200)
Fixes part of Ticket 3797

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/segment.c

index cae0f11..ce784da 100644 (file)
@@ -766,7 +766,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
            av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
            av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
 
-    ret = ff_write_chained(seg->avf, pkt->stream_index, pkt, s, 0);
+    ret = ff_write_chained(seg->avf, pkt->stream_index, pkt, s, seg->initial_offset || seg->reset_timestamps);
 
 fail:
     if (pkt->stream_index == seg->reference_stream_index) {