Skip to content

Commit f4a1ee3

Browse files
committed
deps/media-playback: Add concat playback support
Allows using a makeshift playlist file with media playback.
1 parent 8a5cf99 commit f4a1ee3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

deps/media-playback/media-playback/media.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static bool mp_media_reset(mp_media_t *m)
407407
? av_rescale_q(seek_pos, AV_TIME_BASE_Q, stream->time_base)
408408
: seek_pos;
409409

410-
if (!m->is_network) {
410+
if (!m->is_network && !m->is_concat) {
411411
int ret = av_seek_frame(m->fmt, 0, seek_target, seek_flags);
412412
if (ret < 0) {
413413
blog(LOG_WARNING, "MP: Failed to seek: %s",
@@ -689,6 +689,9 @@ bool mp_media_init(mp_media_t *media,
689689
if (path && *path)
690690
media->is_network = !!strstr(path, "://");
691691

692+
if (format && *format)
693+
media->is_concat = strcmp(format, "concat") == 0;
694+
692695
static bool initialized = false;
693696
if (!initialized) {
694697
av_register_all();

deps/media-playback/media-playback/media.h

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct mp_media {
6363
struct mp_decode v;
6464
struct mp_decode a;
6565
bool is_network;
66+
bool is_concat;
6667
bool has_video;
6768
bool has_audio;
6869
bool is_file;

0 commit comments

Comments
 (0)