mirror of https://github.com/mpv-player/mpv
player: remove some further current_track dependencies
Now it's used for initialization only for audio and video.
This commit is contained in:
parent
1661ba09eb
commit
ffb1d7807e
|
@ -242,6 +242,7 @@ static void reinit_audio_filters_and_output(struct MPContext *mpctx)
|
|||
struct MPOpts *opts = mpctx->opts;
|
||||
struct ao_chain *ao_c = mpctx->ao_chain;
|
||||
assert(ao_c);
|
||||
struct track *track = ao_c->track;
|
||||
struct af_stream *afs = ao_c->af;
|
||||
|
||||
if (ao_c->input_frame)
|
||||
|
@ -358,9 +359,7 @@ static void reinit_audio_filters_and_output(struct MPContext *mpctx)
|
|||
init_error:
|
||||
uninit_audio_chain(mpctx);
|
||||
uninit_audio_out(mpctx);
|
||||
struct track *track = mpctx->current_track[0][STREAM_AUDIO];
|
||||
if (track)
|
||||
error_on_track(mpctx, track);
|
||||
error_on_track(mpctx, track);
|
||||
}
|
||||
|
||||
int init_audio_decoder(struct MPContext *mpctx, struct track *track)
|
||||
|
@ -451,8 +450,7 @@ init_error:
|
|||
uninit_audio_chain(mpctx);
|
||||
uninit_audio_out(mpctx);
|
||||
no_audio:
|
||||
if (track)
|
||||
error_on_track(mpctx, track);
|
||||
error_on_track(mpctx, track);
|
||||
}
|
||||
|
||||
// Return pts value corresponding to the end point of audio written to the
|
||||
|
@ -717,7 +715,7 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
|
|||
d_audio->try_spdif = true;
|
||||
if (!audio_init_best_codec(d_audio)) {
|
||||
MP_ERR(mpctx, "Error reinitializing audio.\n");
|
||||
error_on_track(mpctx, mpctx->current_track[0][STREAM_AUDIO]);
|
||||
error_on_track(mpctx, ao_c->track);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -436,8 +436,7 @@ int reinit_video_chain_src(struct MPContext *mpctx, struct lavfi_pad *src)
|
|||
err_out:
|
||||
no_video:
|
||||
uninit_video_chain(mpctx);
|
||||
if (track)
|
||||
error_on_track(mpctx, track);
|
||||
error_on_track(mpctx, track);
|
||||
handle_force_window(mpctx, true);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1246,6 +1245,7 @@ void write_video(struct MPContext *mpctx, double endpts)
|
|||
|
||||
if (!mpctx->vo_chain)
|
||||
return;
|
||||
struct track *track = mpctx->vo_chain->track;
|
||||
struct vo *vo = mpctx->vo_chain->vo;
|
||||
|
||||
// Actual playback starts when both audio and video are ready.
|
||||
|
@ -1416,7 +1416,7 @@ void write_video(struct MPContext *mpctx, double endpts)
|
|||
error:
|
||||
MP_FATAL(mpctx, "Could not initialize video chain.\n");
|
||||
uninit_video_chain(mpctx);
|
||||
error_on_track(mpctx, mpctx->current_track[STREAM_VIDEO][0]);
|
||||
error_on_track(mpctx, track);
|
||||
handle_force_window(mpctx, true);
|
||||
mpctx->sleeptime = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue