[vlc-commits] Taglib: better fix for year and track deletion

Jean-Baptiste Kempf git at videolan.org
Thu Dec 13 13:58:40 CET 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Dec 13 13:56:36 2012 +0100| [637db5eaa10cfaf8de0b013c1b2623444d106bff] | committer: Jean-Baptiste Kempf

Taglib: better fix for year and track deletion

Ref #5686

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

 modules/meta_engine/taglib.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index 05c5fc2..2561b4c 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -874,11 +874,13 @@ static int WriteMeta( vlc_object_t *p_this )
 #undef SET
 
     psz_meta = input_item_GetDate( p_item );
-    p_tag->setYear( atoi( psz_meta ) );
+    if( !EMPTY_STR(psz_meta) ) p_tag->setYear( atoi( psz_meta ) );
+    else p_tag->setYear( 0 );
     free( psz_meta );
 
     psz_meta = input_item_GetTrackNum( p_item );
-    p_tag->setTrack( atoi( psz_meta ) );
+    if( !EMPTY_STR(psz_meta) ) p_tag->setTrack( atoi( psz_meta ) );
+    else p_tag->setTrack( 0 );
     free( psz_meta );
 
 



More information about the vlc-commits mailing list