diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-08 02:19:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-08 02:37:24 +0200 |
commit | 5312c319be98c63b8e59695222a13068a0dbc7ab (patch) | |
tree | bf96ae523ed22a2888f8eb8a90d80f6d348d3aab | |
parent | 099e57bc38d7e53cf6823dfec349ff9fdaee99ba (diff) | |
download | ffmpeg-5312c319be98c63b8e59695222a13068a0dbc7ab.tar.gz |
avformat_find_stream_info: fallback to timestamps in analyzeduration check in more cases
This fixes speex in rtmp
Fixes Ticket2409
the nellymoser in flv case actually needs larger analyzeduration. The code
previously just failed to calculate the duration
If this causes any problems, like premature analyze/probe end, please report!
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/utils.c | 5 | ||||
-rw-r--r-- | tests/fate/filter-audio.mak | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index c6aa87b506..17dcb259d0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2830,10 +2830,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) t = FFMAX(t, av_rescale_q(st->codec_info_nb_frames, av_inv_q(st->avg_frame_rate), AV_TIME_BASE_Q)); if ( t==0 - && st->codec_info_nb_frames>15 - && st->codec->codec_type == AVMEDIA_TYPE_VIDEO - && ( !strcmp(ic->iformat->name, "mpeg") // this breaks some flvs thus use only for mpegps/ts for now (for ts we have a sample that needs it) - || !strcmp(ic->iformat->name, "mpegts")) + && st->codec_info_nb_frames>30 && st->info->fps_first_dts != AV_NOPTS_VALUE && st->info->fps_last_dts != AV_NOPTS_VALUE) t = FFMAX(t, av_rescale_q(st->info->fps_last_dts - st->info->fps_first_dts, st->time_base, AV_TIME_BASE_Q)); diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak index 4593421f66..944af75482 100644 --- a/tests/fate/filter-audio.mak +++ b/tests/fate/filter-audio.mak @@ -27,7 +27,7 @@ fate-filter-asyncts: REF = $(SAMPLES)/nellymoser/nellymoser-discont-async-v2.pcm FATE_FILTER-$(CONFIG_ARESAMPLE_FILTER) += fate-filter-aresample fate-filter-aresample: SRC = $(SAMPLES)/nellymoser/nellymoser-discont.flv -fate-filter-aresample: CMD = pcm -i $(SRC) -af aresample=min_comp=0.001:min_hard_comp=0.1:first_pts=0 +fate-filter-aresample: CMD = pcm -analyzeduration 10000000 -i $(SRC) -af aresample=min_comp=0.001:min_hard_comp=0.1:first_pts=0 fate-filter-aresample: CMP = oneoff fate-filter-aresample: REF = $(SAMPLES)/nellymoser/nellymoser-discont.pcm |