[FFmpeg-cvslog] ffplay: set time_base of audio filter buffer src
Marton Balint
git at videolan.org
Tue Apr 9 05:00:00 CEST 2013
ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Mar 31 23:53:15 2013 +0200| [325846aac0aefef177d5ef06d5a558c281ead348] | committer: Marton Balint
ffplay: set time_base of audio filter buffer src
Fixes ticket #2408.
Signed-off-by: Marton Balint <cus at passwd.hu>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=325846aac0aefef177d5ef06d5a558c281ead348
---
ffplay.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/ffplay.c b/ffplay.c
index eee9da3..2aaef35 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -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
{
More information about the ffmpeg-cvslog
mailing list