[FFmpeg-cvslog] Fix the packet duration when flushing the encoder.

Thierry Foucu git at videolan.org
Wed Nov 7 22:33:00 CET 2012


ffmpeg | branch: master | Thierry Foucu <tfoucu at gmail.com> | Wed Nov  7 11:33:41 2012 -0800| [98cbbabadb70282a80fdb952a51f832d5f322d93] | committer: Michael Niedermayer

Fix the packet duration when flushing the encoder.

A similar patch was posted by Justin Ruggles <justin.ruggles at gmail.com>

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98cbbabadb70282a80fdb952a51f832d5f322d93
---

 ffmpeg.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index f8cf6b7..3554d9e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1289,6 +1289,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);
             }
 



More information about the ffmpeg-cvslog mailing list