aboutsummaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorThierry Foucu2012-11-07 11:33:41 -0800
committerMichael Niedermayer2012-11-07 22:29:11 +0100
commit98cbbabadb70282a80fdb952a51f832d5f322d93 (patch)
tree9b9d8b84a0fc6f1c2ffe8649d341607cbb38ffdd /ffmpeg.c
parent9dfe07a1fbcd489a210c82596675b43ca7c3ca74 (diff)
Fix the packet duration when flushing the encoder.
A similar patch was posted by Justin Ruggles <justin.ruggles@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index f8cf6b7701..3554d9e08c 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);
}