deps/media-playback: Add concat playback support

Allows using a makeshift playlist file with media playback.
This commit is contained in:
jp9000 2017-08-03 02:07:58 -07:00
parent 8a5cf99aa7
commit f4a1ee3658
2 changed files with 5 additions and 1 deletions

View File

@ -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();

View File

@ -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;