]> git.sesse.net Git - vlc/commitdiff
input/meta.c: Better handle NULL meta.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 16 Aug 2007 18:42:38 +0000 (18:42 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 16 Aug 2007 18:42:38 +0000 (18:42 +0000)
src/input/meta.c

index 419835ee1f20c4127aa8cf394bbe6669205ea22c..f6509d836122e1c6049219a1c34a69bc33be7a16 100644 (file)
@@ -72,7 +72,6 @@ vlc_bool_t input_MetaSatisfied( playlist_t *p_playlist, input_item_t *p_item,
 {
     (void)p_playlist;
     *pi_mandatory = VLC_META_ENGINE_TITLE | VLC_META_ENGINE_ARTIST;
-    assert( p_item->p_meta );
 
     uint32_t i_meta = input_CurrentMetaFlags( p_item->p_meta );
     *pi_mandatory &= ~i_meta;
@@ -85,8 +84,6 @@ int input_MetaFetch( playlist_t *p_playlist, input_item_t *p_item )
     struct meta_engine_t *p_me;
     uint32_t i_mandatory, i_optional;
 
-    assert( p_item->p_meta );
-
     input_MetaSatisfied( p_playlist, p_item, &i_mandatory, &i_optional );
     // Meta shouldn't magically appear
     assert( i_mandatory );
@@ -492,6 +489,9 @@ uint32_t input_CurrentMetaFlags( vlc_meta_t *p_meta )
 {
     uint32_t i_meta = 0;
 
+    if( !p_meta )
+        return 0;
+
 #define CHECK( a, b ) \
     if( !EMPTY_STR( vlc_meta_Get( p_meta, vlc_meta_ ## a ) ) ) \
         i_meta |= VLC_META_ENGINE_ ## b;