mirror of
https://github.com/mpv-player/mpv
synced 2025-02-18 05:37:04 +00:00
player: don't enable demuxer readahead before selecting tracks
This is for the ordered chapters case only. In theory this could have resulted in initial audio, video or subs missing, although it didn't happen in practice (because no streams were selected, thus the demuxer thread didn't actually try to read anything). It's still better to make this explicit. Also, timeline_set_part() can be private to loadfile.c.
This commit is contained in:
parent
730db25b1b
commit
280f123f35
@ -385,7 +385,6 @@ void mp_mark_user_track_selection(struct MPContext *mpctx, int order,
|
||||
enum stream_type type);
|
||||
struct track *mp_track_by_tid(struct MPContext *mpctx, enum stream_type type,
|
||||
int tid);
|
||||
bool timeline_set_part(struct MPContext *mpctx, int i, bool force);
|
||||
double timeline_set_from_time(struct MPContext *mpctx, double pts, bool *need_reset);
|
||||
void add_demuxer_tracks(struct MPContext *mpctx, struct demuxer *demuxer);
|
||||
bool mp_remove_track(struct MPContext *mpctx, struct track *track);
|
||||
|
@ -270,13 +270,13 @@ static void enable_demux_thread(struct MPContext *mpctx)
|
||||
}
|
||||
}
|
||||
|
||||
bool timeline_set_part(struct MPContext *mpctx, int i, bool force)
|
||||
static bool timeline_set_part(struct MPContext *mpctx, int i, bool initial)
|
||||
{
|
||||
struct timeline_part *p = mpctx->timeline + mpctx->timeline_part;
|
||||
struct timeline_part *n = mpctx->timeline + i;
|
||||
mpctx->timeline_part = i;
|
||||
mpctx->video_offset = n->start - n->source_start;
|
||||
if (n->source == p->source && !force)
|
||||
if (n->source == p->source && !initial)
|
||||
return false;
|
||||
|
||||
uninit_audio_chain(mpctx);
|
||||
@ -313,9 +313,11 @@ bool timeline_set_part(struct MPContext *mpctx, int i, bool force)
|
||||
}
|
||||
}
|
||||
}
|
||||
reselect_demux_streams(mpctx);
|
||||
|
||||
enable_demux_thread(mpctx);
|
||||
if (!initial) {
|
||||
reselect_demux_streams(mpctx);
|
||||
enable_demux_thread(mpctx);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user