From acac5fb3bc9558b5aceff62be144019dfc5c1057 Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Thu, 30 Jul 2015 15:35:38 -0700 Subject: [PATCH] metadata: Handle cover art streams that come after the video stream. SF patch #140 (`check_embedded_art` not called when Cover Art at end of file) Using MP4Box, the Cover Art is added after the video stream. Thanks Mathieu Malaterre. --- metadata.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/metadata.c b/metadata.c index ce1d212..c08ca3f 100644 --- a/metadata.c +++ b/metadata.c @@ -694,16 +694,16 @@ GetVideoMetadata(const char *path, char *name) //dump_format(ctx, 0, NULL, 0); for( i=0; inb_streams; i++) { - if( audio_stream == -1 && - ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO ) + if( ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO && + audio_stream == -1 ) { audio_stream = i; ac = ctx->streams[audio_stream]->codec; continue; } - else if( video_stream == -1 && + else if( ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO && !lav_is_thumbnail_stream(ctx->streams[i], &m.thumb_data, &m.thumb_size) && - ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO ) + video_stream == -1 ) { video_stream = i; vc = ctx->streams[video_stream]->codec;