]> git.sesse.net Git - vlc/commitdiff
MKV: correctly set the attachment:// URL for embedded covers
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 16 Feb 2012 15:51:42 +0000 (16:51 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 16 Feb 2012 15:51:42 +0000 (16:51 +0100)
modules/demux/mkv/matroska_segment_parse.cpp

index c91691529051ddab80c9d363e404e35c59477b11..09391da08c7907aa3826bb9b9a45aa98ea367736 100644 (file)
@@ -1008,6 +1008,17 @@ void matroska_segment_c::ParseAttachments( KaxAttachments *attachments )
         {
              memcpy( new_attachment->p_data, img_data.GetBuffer(), img_data.GetSize() );
              sys.stored_attachments.push_back( new_attachment );
+             if( !strncmp( new_attachment->mimeType(), "image/", 6 ) )
+             {
+                 char *psz_url;
+                 if( asprintf( &psz_url, "attachment://%s",
+                             new_attachment->fileName() ) == -1 )
+                     continue;
+                 if( !sys.meta )
+                     sys.meta = vlc_meta_New();
+                 vlc_meta_SetArtURL( sys.meta, psz_url );
+                 free( psz_url );
+             }
         }
         else
         {