avcodec: for audio encoding, set packet dts to packet pts.

There are no audio encoders which do frame reordering.
This commit is contained in:
Justin Ruggles
2012-02-06 19:08:32 -05:00
parent d483bb58c3
commit a75bc764ec
2 changed files with 11 additions and 7 deletions

View File

@@ -991,6 +991,8 @@ static int encode_audio_frame(AVFormatContext *s, OutputStream *ost,
if (got_packet) {
if (pkt.pts != AV_NOPTS_VALUE)
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);