summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demuxer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux/demuxer.c')
-rw-r--r--libmpdemux/demuxer.c39
1 files changed, 15 insertions, 24 deletions
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index 9b38af9452..9efcf91862 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -53,6 +53,7 @@
static void clear_parser(sh_common_t *sh);
// Demuxer list
+extern const struct demuxer_desc demuxer_desc_edl;
extern const demuxer_desc_t demuxer_desc_rawaudio;
extern const demuxer_desc_t demuxer_desc_rawvideo;
extern const demuxer_desc_t demuxer_desc_tv;
@@ -101,6 +102,7 @@ extern const demuxer_desc_t demuxer_desc_mng;
* libraries and demuxers requiring binary support. */
const demuxer_desc_t *const demuxer_list[] = {
+ &demuxer_desc_edl,
&demuxer_desc_rawaudio,
&demuxer_desc_rawvideo,
#ifdef CONFIG_TV
@@ -253,13 +255,13 @@ void free_demux_packet(struct demux_packet *dp)
free(dp);
}
-void free_demuxer_stream(demux_stream_t *ds)
+static void free_demuxer_stream(struct demux_stream *ds)
{
ds_free_packs(ds);
free(ds);
}
-demux_stream_t *new_demuxer_stream(struct demuxer *demuxer, int id)
+static struct demux_stream *new_demuxer_stream(struct demuxer *demuxer, int id)
{
demux_stream_t *ds = malloc(sizeof(demux_stream_t));
*ds = (demux_stream_t){
@@ -881,19 +883,18 @@ void demuxer_help(void)
int i;
mp_msg(MSGT_DEMUXER, MSGL_INFO, "Available demuxers:\n");
- mp_msg(MSGT_DEMUXER, MSGL_INFO, " demuxer: type info: (comment)\n");
+ mp_msg(MSGT_DEMUXER, MSGL_INFO, " demuxer: info: (comment)\n");
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_DEMUXERS\n");
for (i = 0; demuxer_list[i]; i++) {
- if (demuxer_list[i]->type > DEMUXER_TYPE_MAX) // Don't display special demuxers
+ if (demuxer_list[i]->type >= DEMUXER_TYPE_END) // internal type
continue;
if (demuxer_list[i]->comment && strlen(demuxer_list[i]->comment))
- mp_msg(MSGT_DEMUXER, MSGL_INFO, "%10s %2d %s (%s)\n",
- demuxer_list[i]->name, demuxer_list[i]->type,
- demuxer_list[i]->info, demuxer_list[i]->comment);
+ mp_msg(MSGT_DEMUXER, MSGL_INFO, "%10s %s (%s)\n",
+ demuxer_list[i]->name, demuxer_list[i]->info,
+ demuxer_list[i]->comment);
else
- mp_msg(MSGT_DEMUXER, MSGL_INFO, "%10s %2d %s\n",
- demuxer_list[i]->name, demuxer_list[i]->type,
- demuxer_list[i]->info);
+ mp_msg(MSGT_DEMUXER, MSGL_INFO, "%10s %s\n",
+ demuxer_list[i]->name, demuxer_list[i]->info);
}
}
@@ -906,32 +907,22 @@ void demuxer_help(void)
* May be NULL.
* @return DEMUXER_TYPE_xxx, -1 if error or not found
*/
-int get_demuxer_type_from_name(char *demuxer_name, int *force)
+static int get_demuxer_type_from_name(char *demuxer_name, int *force)
{
- int i;
- long type_int;
- char *endptr;
-
if (!demuxer_name || !demuxer_name[0])
return DEMUXER_TYPE_UNKNOWN;
if (force)
*force = demuxer_name[0] == '+';
if (demuxer_name[0] == '+')
demuxer_name = &demuxer_name[1];
- for (i = 0; demuxer_list[i]; i++) {
- if (demuxer_list[i]->type > DEMUXER_TYPE_MAX) // Can't select special demuxers from commandline
+ for (int i = 0; demuxer_list[i]; i++) {
+ if (demuxer_list[i]->type >= DEMUXER_TYPE_END)
+ // Can't select special demuxers from commandline
continue;
if (strcmp(demuxer_name, demuxer_list[i]->name) == 0)
return demuxer_list[i]->type;
}
- // No match found, try to parse name as an integer (demuxer number)
- type_int = strtol(demuxer_name, &endptr, 0);
- if (*endptr) // Conversion failed
- return -1;
- if ((type_int > 0) && (type_int <= DEMUXER_TYPE_MAX))
- return (int) type_int;
-
return -1;
}