[vlc-commits] Taglib: extract DiscNumber/DiscTotal from ID3v2

Jean-Baptiste Kempf git at videolan.org
Fri Oct 16 19:08:55 CEST 2015


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Oct 16 19:00:42 2015 +0200| [c925c78d5a3a31ce21b29cc4a9309f14c5f02737] | committer: Jean-Baptiste Kempf

Taglib: extract DiscNumber/DiscTotal from ID3v2

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

 modules/meta_engine/taglib.cpp |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index 417b352..0923f1d 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -383,7 +383,6 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_meta_t* p_demux_meta, vlc_
     SET( "TLAN", Language );
     SET( "TPUB", Publisher );
     SET( "TPE2", AlbumArtist );
-    SET( "TPOS", DiscNumber );
 
 #undef SET
 
@@ -395,6 +394,14 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_meta_t* p_demux_meta, vlc_
                 vlc_meta_TrackNumber, vlc_meta_TrackTotal );
     }
 
+    /* */
+    list = tag->frameListMap()["TPOS"];
+    if( !list.isEmpty() )
+    {
+        ExtractCoupleNumberValues( p_meta, (*list.begin())->toString().toCString( true ),
+                vlc_meta_DiscNumber, vlc_meta_DiscTotal );
+    }
+
     /* Preferred type of image
      * The 21 types are defined in id3v2 standard:
      * http://www.id3.org/id3v2.4.0-frames */



More information about the vlc-commits mailing list