From 4527409c8d968564de53e4dcf4021ff3ae2843b5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 21 Feb 2018 15:43:24 +0100 Subject: audio: improve behavior if filters output nothing during probing Just bail out immediately (and disable audio) if format probing has no result, instead of doing nothing and then apparently freezing. This can happen with bogus filters, cases where the first audio frame is essentially dropped by filters (can happen with large resampling factors), and if the audio track contains no packets at all, or all packets fail to decode. --- player/audio.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'player') diff --git a/player/audio.c b/player/audio.c index 37c5446bd9..a6b7601df2 100644 --- a/player/audio.c +++ b/player/audio.c @@ -272,6 +272,11 @@ static void reinit_audio_filters_and_output(struct MPContext *mpctx) if (!out_fmt) abort(); + if (!mp_aframe_config_is_valid(out_fmt)) { + talloc_free(out_fmt); + goto init_error; + } + if (af_fmt_is_pcm(mp_aframe_get_format(out_fmt))) { if (opts->force_srate) mp_aframe_set_rate(out_fmt, opts->force_srate); -- cgit v1.2.3