summaryrefslogtreecommitdiffstats
path: root/demux/demux_playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'demux/demux_playlist.c')
-rw-r--r--demux/demux_playlist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/demux/demux_playlist.c b/demux/demux_playlist.c
index ff252bb417..25ad22bddb 100644
--- a/demux/demux_playlist.c
+++ b/demux/demux_playlist.c
@@ -54,6 +54,7 @@ struct pl_parser {
bool add_base;
enum demux_check check_level;
struct stream *real_stream;
+ char *format;
};
static char *pl_get_line0(struct pl_parser *p)
@@ -120,6 +121,8 @@ ok:
talloc_free(title);
title = bstrto0(NULL, btitle);
}
+ } else if (bstr_startswith0(line, "#EXT-X-")) {
+ p->format = "hls";
} else if (line.len > 0 && !bstr_startswith0(line, "#")) {
char *fn = bstrto0(NULL, line);
struct playlist_entry *e = playlist_entry_new(fn);
@@ -338,7 +341,7 @@ static int open_file(struct demuxer *demuxer, enum demux_check check)
if (p->add_base)
playlist_add_base_path(p->pl, mp_dirname(demuxer->filename));
demuxer->playlist = talloc_steal(demuxer, p->pl);
- demuxer->filetype = fmt->name;
+ demuxer->filetype = p->format ? p->format : fmt->name;
demuxer->fully_read = true;
talloc_free(p);
return ok ? 0 : -1;