diff options
author | Marton Balint <cus@passwd.hu> | 2013-03-31 23:53:15 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2013-04-08 22:21:45 +0200 |
commit | 325846aac0aefef177d5ef06d5a558c281ead348 (patch) | |
tree | ff6ccd39c20b73c18c65541e9532fea05aa7c36a /ffplay.c | |
parent | ed8373e7db14e608641f4db4f2dc3047048013f3 (diff) | |
download | ffmpeg-325846aac0aefef177d5ef06d5a558c281ead348.tar.gz |
ffplay: set time_base of audio filter buffer src
Fixes ticket #2408.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1828,9 +1828,10 @@ static int configure_audio_filters(VideoState *is, const char *afilters, int for return AVERROR(ENOMEM); ret = snprintf(asrc_args, sizeof(asrc_args), - "sample_rate=%d:sample_fmt=%s:channels=%d", + "sample_rate=%d:sample_fmt=%s:channels=%d:time_base=%d/%d", is->audio_filter_src.freq, av_get_sample_fmt_name(is->audio_filter_src.fmt), - is->audio_filter_src.channels); + is->audio_filter_src.channels, + 1, is->audio_filter_src.freq); if (is->audio_filter_src.channel_layout) snprintf(asrc_args + ret, sizeof(asrc_args) - ret, ":channel_layout=0x%"PRIx64, is->audio_filter_src.channel_layout); @@ -2190,11 +2191,13 @@ static int audio_decode_frame(VideoState *is) continue; } + tb = (AVRational){1, is->frame->sample_rate}; + if (is->frame->pts != AV_NOPTS_VALUE) + is->frame->pts = av_rescale_q(is->frame->pts, dec->time_base, tb); if (is->frame->pts == AV_NOPTS_VALUE && pkt_temp->pts != AV_NOPTS_VALUE) - is->frame->pts = av_rescale_q(pkt_temp->pts, is->audio_st->time_base, dec->time_base); + is->frame->pts = av_rescale_q(pkt_temp->pts, is->audio_st->time_base, tb); if (pkt_temp->pts != AV_NOPTS_VALUE) pkt_temp->pts += (double) is->frame->nb_samples / is->frame->sample_rate / av_q2d(is->audio_st->time_base); - tb = dec->time_base; #if CONFIG_AVFILTER { |