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>
pull/6/merge
Thierry Foucu 12 years ago committed by Michael Niedermayer
parent 9dfe07a1fb
commit 98cbbabadb
  1. 2
      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); pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base);
if (pkt.dts != AV_NOPTS_VALUE) if (pkt.dts != AV_NOPTS_VALUE)
pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base); 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); write_frame(os, &pkt, ost);
} }

Loading…
Cancel
Save