demux: get rid of ->control callback

The only thing left is the notification for track switching. Just get
rid of that.

There's probably no real reason to get rid of control(), but why not. I
think I was actually trying to do some real work but fuck that.
This commit is contained in:
wm4 2018-09-07 23:10:14 +02:00
parent 5114c69c7f
commit 18180ae89b
4 changed files with 9 additions and 24 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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,
};

View File

@ -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,
};