mirror of
https://github.com/mpv-player/mpv
synced 2024-12-19 21:31:52 +00:00
player: handle audio playback restart in central playback start code
No idea why this wasn't done earlier. This makes playback start in audio only tracks closer to video-only or video/audio restart. It has the consequence that --cache-pause-initial now works for audio-only streams too.
This commit is contained in:
parent
b71c8251b0
commit
5103b5dc2c
@ -1225,10 +1225,8 @@ void fill_audio_out_buffers(struct MPContext *mpctx)
|
||||
// Even if we're done decoding and syncing, let video start first - this is
|
||||
// required, because sending audio to the AO already starts playback.
|
||||
if (mpctx->audio_status == STATUS_READY) {
|
||||
if (mpctx->vo_chain && !mpctx->vo_chain->is_coverart &&
|
||||
mpctx->video_status <= STATUS_READY)
|
||||
return;
|
||||
MP_VERBOSE(mpctx, "starting audio playback\n");
|
||||
// Warning: relies on handle_playback_restart() being called afterwards.
|
||||
return;
|
||||
}
|
||||
|
||||
bool audio_eof = status == AD_EOF;
|
||||
|
@ -976,7 +976,15 @@ static void handle_playback_restart(struct MPContext *mpctx)
|
||||
return;
|
||||
}
|
||||
|
||||
// Video needed, but not started yet -> wait.
|
||||
if (mpctx->vo_chain && !mpctx->vo_chain->is_coverart &&
|
||||
mpctx->video_status <= STATUS_READY)
|
||||
return;
|
||||
|
||||
MP_VERBOSE(mpctx, "starting audio playback\n");
|
||||
mpctx->audio_status = STATUS_PLAYING;
|
||||
fill_audio_out_buffers(mpctx); // actually play prepared buffer
|
||||
mp_wakeup_core(mpctx);
|
||||
}
|
||||
|
||||
if (!mpctx->restart_complete) {
|
||||
|
Loading…
Reference in New Issue
Block a user