player: allow changing playback speed in early audio init stages

If the audio decoder was created, but no audio filter chain created yet
(still trying to decode a first audio frame), setting the "speed"
property could explode. It tried to recreate the filter chain, even
though no format was set yet.

This is inconvenient and should not happen.

(cherry picked from commit 720d4a5a1a)
This commit is contained in:
wm4 2015-03-06 12:10:12 +01:00 committed by Diogo Franco (Kovensky)
parent 0b141eaa82
commit 1a3a3aba63
1 changed files with 1 additions and 1 deletions

View File

@ -133,7 +133,7 @@ void set_playback_speed(struct MPContext *mpctx, double new_speed)
opts->playback_speed = new_speed;
if (!mpctx->d_audio)
if (!mpctx->d_audio || mpctx->d_audio->afilter->initialized < 1)
return;
recreate_audio_filters(mpctx);