On 09/22/2012 02:44 PM, Anton Khirnov wrote: > > On Wed, 19 Sep 2012 18:53:06 -0400, Justin Ruggles <justin.rugg...@gmail.com> > wrote: >> --- >> avconv.c | 11 +++++++---- >> 1 files changed, 7 insertions(+), 4 deletions(-) >> >> diff --git a/avconv.c b/avconv.c >> index df09b21..e07a2cd 100644 >> --- a/avconv.c >> +++ b/avconv.c >> @@ -1191,10 +1191,6 @@ static int decode_audio(InputStream *ist, AVPacket >> *pkt, int *got_output) >> } >> } >> >> - if (decoded_frame->pts != AV_NOPTS_VALUE) >> - decoded_frame->pts = av_rescale_q(decoded_frame->pts, >> - ist->st->time_base, >> - (AVRational){1, >> ist->st->codec->sample_rate}); >> for (i = 0; i < ist->nb_filters; i++) >> av_buffersrc_write_frame(ist->filters[i]->filter, decoded_frame); >> >> @@ -1336,6 +1332,13 @@ static int output_packet(InputStream *ist, const >> AVPacket *pkt) >> if (pkt->dts != AV_NOPTS_VALUE) >> ist->next_dts = ist->last_dts = av_rescale_q(pkt->dts, >> ist->st->time_base, AV_TIME_BASE_Q); >> >> + // rescale pts to decoder time_base for audio >> + if (ist->decoding_needed && ist->st->codec->codec_type == >> AVMEDIA_TYPE_AUDIO) { >> + if (avpkt.pts != AV_NOPTS_VALUE) >> + avpkt.pts = av_rescale_q(avpkt.pts, ist->st->time_base, >> + ist->st->codec->time_base); >> + } >> + > > I'd rather see this in decode_audio(). Or is there something preventing > us from moving it there?
Yeah, I suppose it could be done there if we continue set pkt->pts to AV_NOPTS_VALUE after decoding the first frame from the packet. -Justin _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel