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.
This commit is contained in:
Justin Maggard 2015-07-30 15:35:38 -07:00
parent b78c25f260
commit acac5fb3bc

View File

@ -694,16 +694,16 @@ GetVideoMetadata(const char *path, char *name)
//dump_format(ctx, 0, NULL, 0);
for( i=0; i<ctx->nb_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;