player: fix DVD playback

Crashed in case of lazily added subtitle streams, which add tracks with
track->stream set to NULL.

Fixes gituhub issue #439.
This commit is contained in:
wm4 2014-01-01 16:18:48 +01:00
parent 66fe4f5713
commit aeb9e6ddf5
1 changed files with 1 additions and 1 deletions

View File

@ -281,7 +281,7 @@ void reselect_demux_streams(struct MPContext *mpctx)
// Note: we assume that all demuxer streams are covered by the track list.
for (int t = 0; t < mpctx->num_tracks; t++) {
struct track *track = mpctx->tracks[t];
if (track->demuxer)
if (track->demuxer && track->stream)
demuxer_select_track(track->demuxer, track->stream, track->selected);
}
}