mirror of https://github.com/mpv-player/mpv
player: don't segfault when unloading tracks
e1e714ccc
introduced a regression here when unloading a track (e.g. on
VO/AO initilization error), due to no corresponding option existing for
video/audio tracks with orders above 0, but the loop in
`mp_deselect_track` being hard-coded to clear tracks up to NUM_PTRACKS.
Introduce the simplest possible hackaround.
This commit is contained in:
parent
7e52e72746
commit
ec7f2388af
|
@ -591,6 +591,8 @@ static void mark_track_selection(struct MPContext *mpctx, int order,
|
|||
{
|
||||
assert(order >= 0 && order < NUM_PTRACKS);
|
||||
mpctx->opts->stream_id[order][type] = value;
|
||||
if (type != STREAM_SUB && order != 0)
|
||||
return; // mconfig only contains one track for vid/aid
|
||||
m_config_notify_change_opt_ptr(mpctx->mconfig,
|
||||
&mpctx->opts->stream_id[order][type]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue