summaryrefslogtreecommitdiffstats
path: root/player/core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-23 20:14:54 +0100
committerwm4 <wm4@nowhere>2013-12-24 17:44:34 +0100
commitb796f2bb7693676056d0de98a9a95258909d799b (patch)
treea7c23c5a39b7cb817c911b68854e6304bfe7ea19 /player/core.h
parent96e6f3f4b6a7379fac6b61c741c57ccfc062f915 (diff)
downloadmpv-b796f2bb7693676056d0de98a9a95258909d799b.tar.bz2
mpv-b796f2bb7693676056d0de98a9a95258909d799b.tar.xz
player: redo demuxer stream selection
Use struct track to decide what stream to select. Add a "selected" field and use that in some places instead of checking mpctx->current_track.
Diffstat (limited to 'player/core.h')
-rw-r--r--player/core.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/player/core.h b/player/core.h
index 5b4cc738e5..2f0622de7c 100644
--- a/player/core.h
+++ b/player/core.h
@@ -108,6 +108,10 @@ enum seek_type {
struct track {
enum stream_type type;
+
+ // Currently used for decoding.
+ bool selected;
+
// The type specific ID, also called aid (audio), sid (subs), vid (video).
// For UI purposes only; this ID doesn't have anything to do with any
// IDs coming from demuxers or container files.
@@ -198,8 +202,6 @@ typedef struct MPContext {
// Selected tracks. NULL if no track selected.
struct track *current_track[STREAM_TYPE_COUNT];
- struct sh_stream *sh[STREAM_TYPE_COUNT];
-
struct dec_video *d_video;
struct dec_audio *d_audio;
struct dec_sub *d_sub;
@@ -367,13 +369,13 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask);
struct track *mp_add_subtitles(struct MPContext *mpctx, char *filename);
void mp_switch_track(struct MPContext *mpctx, enum stream_type type,
struct track *track);
+void mp_deselect_track(struct MPContext *mpctx, struct track *track);
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);
-struct sh_stream *init_demux_stream(struct MPContext *mpctx,
- enum stream_type type);
-void cleanup_demux_stream(struct MPContext *mpctx, enum stream_type type);
+struct sh_stream *init_demux_stream(struct MPContext *mpctx, struct track *track);
+void reselect_demux_streams(struct MPContext *mpctx);
void add_demuxer_tracks(struct MPContext *mpctx, struct demuxer *demuxer);
bool mp_remove_track(struct MPContext *mpctx, struct track *track);
struct playlist_entry *mp_next_file(struct MPContext *mpctx, int direction,