diff options
Diffstat (limited to 'player/loadfile.c')
-rw-r--r-- | player/loadfile.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/player/loadfile.c b/player/loadfile.c index bae8f74fe9..c2242ea7c2 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -351,14 +351,6 @@ double timeline_set_from_time(struct MPContext *mpctx, double pts, bool *need_re return -1; } -// Map stream number (as used by libdvdread) to MPEG IDs (as used by demuxer). -static int map_id_from_demuxer(struct demuxer *d, enum stream_type type, int id) -{ - if (d->stream->uncached_type == STREAMTYPE_DVD && type == STREAM_SUB) - id = id & 0x1F; - return id; -} - static int find_new_tid(struct MPContext *mpctx, enum stream_type t) { int new_id = 0; @@ -378,22 +370,6 @@ static struct track *add_stream_track(struct MPContext *mpctx, struct track *track = mpctx->tracks[i]; if (track->stream == stream) return track; - // DVD subtitle track that was added later - if (stream->type == STREAM_SUB && track->type == STREAM_SUB && - map_id_from_demuxer(stream->demuxer, stream->type, - stream->demuxer_id) == track->demuxer_id - && !track->stream) - { - track->stream = stream; - track->demuxer_id = stream->demuxer_id; - // Initialize lazily selected track - demuxer_select_track(track->demuxer, stream, track->selected); - if (mpctx->current_track[0][STREAM_SUB] == track) - reinit_subs(mpctx, 0); - if (mpctx->current_track[1][STREAM_SUB] == track) - reinit_subs(mpctx, 1); - return track; - } } struct track *track = talloc_ptrtype(NULL, track); @@ -411,21 +387,6 @@ static struct track *add_stream_track(struct MPContext *mpctx, }; MP_TARRAY_APPEND(mpctx, mpctx->tracks, mpctx->num_tracks, track); - // Needed for DVD and Blu-ray. - struct stream *st = track->demuxer->stream; - if (!track->lang && (st->uncached_type == STREAMTYPE_BLURAY || - st->uncached_type == STREAMTYPE_DVD)) - { - struct stream_lang_req req = { - .type = track->type, - .id = map_id_from_demuxer(track->demuxer, track->type, - track->demuxer_id) - }; - stream_control(st, STREAM_CTRL_GET_LANG, &req); - if (req.name[0]) - track->lang = talloc_strdup(track, req.name); - } - demuxer_select_track(track->demuxer, stream, false); mp_notify(mpctx, MPV_EVENT_TRACKS_CHANGED, NULL); @@ -439,34 +400,6 @@ void add_demuxer_tracks(struct MPContext *mpctx, struct demuxer *demuxer) add_stream_track(mpctx, demuxer->streams[n], !!mpctx->timeline); } -static void add_dvd_tracks(struct MPContext *mpctx) -{ - struct demuxer *demuxer = mpctx->demuxer; - struct stream *stream = demuxer->stream; - struct stream_dvd_info_req info; - if (stream->uncached_type != STREAMTYPE_DVD) - return; - if (stream_control(stream, STREAM_CTRL_GET_DVD_INFO, &info) > 0) { - for (int n = 0; n < info.num_subs; n++) { - struct track *track = talloc_ptrtype(NULL, track); - *track = (struct track) { - .type = STREAM_SUB, - .user_tid = find_new_tid(mpctx, STREAM_SUB), - .demuxer_id = n, - .demuxer = mpctx->demuxer, - }; - MP_TARRAY_APPEND(mpctx, mpctx->tracks, mpctx->num_tracks, track); - - struct stream_lang_req req = {.type = STREAM_SUB, .id = n}; - stream_control(stream, STREAM_CTRL_GET_LANG, &req); - track->lang = talloc_strdup(track, req.name); - - mp_notify(mpctx, MPV_EVENT_TRACKS_CHANGED, NULL); - } - } - demuxer_enable_autoselect(demuxer); -} - // Result numerically higher => better match. 0 == no match. static int match_lang(char **langs, char *lang) { @@ -1182,7 +1115,6 @@ goto_reopen_demuxer: ; mpctx->demuxer = mpctx->timeline[0].source; main_is_ok: ; } - add_dvd_tracks(mpctx); add_demuxer_tracks(mpctx, mpctx->demuxer); mpctx->timeline_part = 0; |