diff options
author | wm4 <wm4@nowhere> | 2018-02-21 15:43:24 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-02-21 22:35:24 -0800 |
commit | 4527409c8d968564de53e4dcf4021ff3ae2843b5 (patch) | |
tree | 492832282a86e6a17a56fb7351cf2aef025db60b /player/audio.c | |
parent | 7f714c6984b3ca0ee49a76cbb46fbeb520519401 (diff) | |
download | mpv-4527409c8d968564de53e4dcf4021ff3ae2843b5.tar.bz2 mpv-4527409c8d968564de53e4dcf4021ff3ae2843b5.tar.xz |
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.
Diffstat (limited to 'player/audio.c')
-rw-r--r-- | player/audio.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |