mirror of https://github.com/mpv-player/mpv
demux: don't require fill_buffer callback
This commit is contained in:
parent
c412f7daf6
commit
d064c69e1c
|
@ -599,7 +599,7 @@ static bool demux_check_queue_full(demuxer_t *demux)
|
||||||
int demux_fill_buffer(demuxer_t *demux, demux_stream_t *ds)
|
int demux_fill_buffer(demuxer_t *demux, demux_stream_t *ds)
|
||||||
{
|
{
|
||||||
// Note: parameter 'ds' can be NULL!
|
// Note: parameter 'ds' can be NULL!
|
||||||
return demux->desc->fill_buffer(demux, ds);
|
return demux->desc->fill_buffer ? demux->desc->fill_buffer(demux, ds) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// return value:
|
// return value:
|
||||||
|
|
|
@ -47,11 +47,6 @@ static int try_open_file(struct demuxer *demuxer)
|
||||||
return DEMUXER_TYPE_CUE;
|
return DEMUXER_TYPE_CUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dummy_fill_buffer(struct demuxer *demuxer, struct demux_stream *ds)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const struct demuxer_desc demuxer_desc_cue = {
|
const struct demuxer_desc demuxer_desc_cue = {
|
||||||
.info = "CUE file demuxer",
|
.info = "CUE file demuxer",
|
||||||
.name = "cue",
|
.name = "cue",
|
||||||
|
@ -61,5 +56,4 @@ const struct demuxer_desc demuxer_desc_cue = {
|
||||||
.type = DEMUXER_TYPE_CUE,
|
.type = DEMUXER_TYPE_CUE,
|
||||||
.safe_check = true,
|
.safe_check = true,
|
||||||
.check_file = try_open_file, // no separate .open
|
.check_file = try_open_file, // no separate .open
|
||||||
.fill_buffer = dummy_fill_buffer,
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,11 +40,6 @@ static int try_open_file(struct demuxer *demuxer)
|
||||||
return DEMUXER_TYPE_EDL;
|
return DEMUXER_TYPE_EDL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dummy_fill_buffer(struct demuxer *demuxer, struct demux_stream *ds)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const struct demuxer_desc demuxer_desc_edl = {
|
const struct demuxer_desc demuxer_desc_edl = {
|
||||||
.info = "EDL file demuxer",
|
.info = "EDL file demuxer",
|
||||||
.name = "edl",
|
.name = "edl",
|
||||||
|
@ -54,5 +49,4 @@ const struct demuxer_desc demuxer_desc_edl = {
|
||||||
.type = DEMUXER_TYPE_EDL,
|
.type = DEMUXER_TYPE_EDL,
|
||||||
.safe_check = true,
|
.safe_check = true,
|
||||||
.check_file = try_open_file, // no separate .open
|
.check_file = try_open_file, // no separate .open
|
||||||
.fill_buffer = dummy_fill_buffer,
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue