diff --git a/demux/demux.c b/demux/demux.c index cf94805384..cac4874e8b 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1732,8 +1732,8 @@ static void execute_trackswitch(struct demux_internal *in) pthread_mutex_unlock(&in->lock); - if (in->d_thread->desc->control) - in->d_thread->desc->control(in->d_thread, DEMUXER_CTRL_SWITCHED_TRACKS, 0); + if (in->d_thread->desc->switched_tracks) + in->d_thread->desc->switched_tracks(in->d_thread); pthread_mutex_lock(&in->lock); } diff --git a/demux/demux.h b/demux/demux.h index ed013a043c..3674f7ea34 100644 --- a/demux/demux.h +++ b/demux/demux.h @@ -30,10 +30,6 @@ #include "packet.h" #include "stheader.h" -enum demux_ctrl { - DEMUXER_CTRL_SWITCHED_TRACKS = 1, -}; - #define MAX_SEEK_RANGES 10 struct demux_seek_range { @@ -107,7 +103,7 @@ typedef struct demuxer_desc { bool (*read_packet)(struct demuxer *demuxer, struct demux_packet **pkt); void (*close)(struct demuxer *demuxer); void (*seek)(struct demuxer *demuxer, double rel_seek_secs, int flags); - int (*control)(struct demuxer *demuxer, int cmd, void *arg); + void (*switched_tracks)(struct demuxer *demuxer); // See timeline.c void (*load_timeline)(struct timeline *tl); } demuxer_desc_t; diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index eae78f9b4c..d6e14b8617 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -1185,15 +1185,9 @@ static void demux_seek_lavf(demuxer_t *demuxer, double seek_pts, int flags) update_read_stats(demuxer); } -static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg) +static void demux_lavf_switched_tracks(struct demuxer *demuxer) { - switch (cmd) { - case DEMUXER_CTRL_SWITCHED_TRACKS: - select_tracks(demuxer, 0); - return CONTROL_OK; - default: - return CONTROL_UNKNOWN; - } + select_tracks(demuxer, 0); } static void demux_close_lavf(demuxer_t *demuxer) @@ -1235,5 +1229,5 @@ const demuxer_desc_t demuxer_desc_lavf = { .open = demux_open_lavf, .close = demux_close_lavf, .seek = demux_seek_lavf, - .control = demux_lavf_control, + .switched_tracks = demux_lavf_switched_tracks, }; diff --git a/demux/demux_timeline.c b/demux/demux_timeline.c index d0c1740e9e..49046222d9 100644 --- a/demux/demux_timeline.c +++ b/demux/demux_timeline.c @@ -435,14 +435,9 @@ static void d_close(struct demuxer *demuxer) demux_free(master); } -static int d_control(struct demuxer *demuxer, int cmd, void *arg) +static void d_switched_tracks(struct demuxer *demuxer) { - if (cmd == DEMUXER_CTRL_SWITCHED_TRACKS) { - reselect_streams(demuxer); - return CONTROL_OK; - } - - return CONTROL_UNKNOWN; + reselect_streams(demuxer); } const demuxer_desc_t demuxer_desc_timeline = { @@ -452,5 +447,5 @@ const demuxer_desc_t demuxer_desc_timeline = { .open = d_open, .close = d_close, .seek = d_seek, - .control = d_control, + .switched_tracks = d_switched_tracks, };