]> git.sesse.net Git - vlc/commitdiff
Taglib: better fix for year and track deletion
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 13 Dec 2012 12:56:36 +0000 (13:56 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 13 Dec 2012 12:57:56 +0000 (13:57 +0100)
Ref #5686

modules/meta_engine/taglib.cpp

index 05c5fc27fa637ad9ca362346c34ec6fd023e0d14..2561b4cc234e5f8d7e8f44f41238bd7e60cfe601 100644 (file)
@@ -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 );