deps/media-playback: Add concat playback support
Allows using a makeshift playlist file with media playback.
This commit is contained in:
parent
8a5cf99aa7
commit
f4a1ee3658
5
deps/media-playback/media-playback/media.c
vendored
5
deps/media-playback/media-playback/media.c
vendored
@ -407,7 +407,7 @@ static bool mp_media_reset(mp_media_t *m)
|
||||
? av_rescale_q(seek_pos, AV_TIME_BASE_Q, stream->time_base)
|
||||
: seek_pos;
|
||||
|
||||
if (!m->is_network) {
|
||||
if (!m->is_network && !m->is_concat) {
|
||||
int ret = av_seek_frame(m->fmt, 0, seek_target, seek_flags);
|
||||
if (ret < 0) {
|
||||
blog(LOG_WARNING, "MP: Failed to seek: %s",
|
||||
@ -689,6 +689,9 @@ bool mp_media_init(mp_media_t *media,
|
||||
if (path && *path)
|
||||
media->is_network = !!strstr(path, "://");
|
||||
|
||||
if (format && *format)
|
||||
media->is_concat = strcmp(format, "concat") == 0;
|
||||
|
||||
static bool initialized = false;
|
||||
if (!initialized) {
|
||||
av_register_all();
|
||||
|
1
deps/media-playback/media-playback/media.h
vendored
1
deps/media-playback/media-playback/media.h
vendored
@ -63,6 +63,7 @@ struct mp_media {
|
||||
struct mp_decode v;
|
||||
struct mp_decode a;
|
||||
bool is_network;
|
||||
bool is_concat;
|
||||
bool has_video;
|
||||
bool has_audio;
|
||||
bool is_file;
|
||||
|
Loading…
x
Reference in New Issue
Block a user