From a0804329927904fdeb70d9712ff23baaab161bb4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 1 Feb 2016 22:28:47 +0100 Subject: player: refactor: reduce some dependencies on current_track Don't mind me. --- player/command.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index fd793c87c9..c753a42c97 100644 --- a/player/command.c +++ b/player/command.c @@ -1831,11 +1831,7 @@ static struct track* track_next(struct MPContext *mpctx, int order, struct track *cur = mpctx->tracks[n]; // One track can be selected only one time - pretend already selected // tracks don't exist. - for (int r = 0; r < NUM_PTRACKS; r++) { - if (r != order && mpctx->current_track[r][type] == cur) - cur = NULL; - } - if (!cur) + if (cur->selected) continue; if (cur->type == type) { if (cur == track) { @@ -2518,9 +2514,9 @@ static int mp_property_vd_imgparams(void *ctx, struct m_property *prop, { MPContext *mpctx = ctx; struct vo_chain *vo_c = mpctx->vo_chain; - struct track *track = mpctx->current_track[0][STREAM_VIDEO]; - if (!vo_c || !track) + if (!vo_c) return M_PROPERTY_UNAVAILABLE; + struct track *track = mpctx->current_track[0][STREAM_VIDEO]; struct mp_codec_params *c = track && track->stream ? track->stream->codec : NULL; if (vo_c->vf->input_params.imgfmt) { -- cgit v1.2.3