avconv: rescale packet duration to muxer time base when flushing encoders
authorJustin Ruggles <justin.ruggles@gmail.com>
Tue, 6 Nov 2012 19:24:31 +0000 (14:24 -0500)
committerJustin Ruggles <justin.ruggles@gmail.com>
Thu, 8 Nov 2012 18:57:34 +0000 (13:57 -0500)
Fixes Bug 385

avconv.c

index 964847a..c931c46 100644 (file)
--- a/avconv.c
+++ b/avconv.c
@@ -964,6 +964,8 @@ static void flush_encoders(void)
                     pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base);
                 if (pkt.dts != AV_NOPTS_VALUE)
                     pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base);
+                if (pkt.duration > 0)
+                    pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base);
                 write_frame(os, &pkt, ost);
             }