Skip to content

Commit

Permalink
player/misc: fix audio-only fallback when video init fails
Browse files Browse the repository at this point in the history
--stop-playback-on-init-failure=no is documented to continue playback in
audio-only mode if video init fails. However, this does not function
properly after a080432: because video
is initialized first, if video init fails, ao_chain is still null.
As a result, !(mpctx->vo_chain || mpctx->ao_chain) is true, a playback
error is raised, so the playback ends and audio does not play.

Fix this by reverting that change, so it checks the tracks instead.

Fixes: a080432
  • Loading branch information
na-na-hi authored and Dudemanguy committed Apr 16, 2024
1 parent d23f641 commit 3281719
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion player/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ void error_on_track(struct MPContext *mpctx, struct track *track)
if (track->type == STREAM_VIDEO)
MP_INFO(mpctx, "Video: no video\n");
if (mpctx->opts->stop_playback_on_init_failure ||
!(mpctx->vo_chain || mpctx->ao_chain))
(!mpctx->current_track[0][STREAM_AUDIO] &&
!mpctx->current_track[0][STREAM_VIDEO]))
{
if (!mpctx->stop_play)
mpctx->stop_play = PT_ERROR;
Expand Down

0 comments on commit 3281719

Please sign in to comment.