Explorar el Código

deps/media-playback: Add concat playback support

Allows using a makeshift playlist file with media playback.
jp9000 hace 8 años
padre
commit
f4a1ee3658

+ 4 - 1
deps/media-playback/media-playback/media.c

@@ -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 - 0
deps/media-playback/media-playback/media.h

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