[vlc-commits] MKV: correctly set the attachment:// URL for embedded covers

Jean-Baptiste Kempf git at videolan.org
Thu Feb 16 17:04:13 CET 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Feb 16 16:51:42 2012 +0100| [c3119df28b2b90248efed5ee09c5cf6f9bf26bfc] | committer: Jean-Baptiste Kempf

MKV: correctly set the attachment:// URL for embedded covers

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c3119df28b2b90248efed5ee09c5cf6f9bf26bfc
---

 modules/demux/mkv/matroska_segment_parse.cpp |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index c916915..09391da 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -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
         {



More information about the vlc-commits mailing list