Commit 7ba6fdab authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

input/meta.c: Better handle NULL meta.

parent 866dd6dc
...@@ -72,7 +72,6 @@ vlc_bool_t input_MetaSatisfied( playlist_t *p_playlist, input_item_t *p_item, ...@@ -72,7 +72,6 @@ vlc_bool_t input_MetaSatisfied( playlist_t *p_playlist, input_item_t *p_item,
{ {
(void)p_playlist; (void)p_playlist;
*pi_mandatory = VLC_META_ENGINE_TITLE | VLC_META_ENGINE_ARTIST; *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 ); uint32_t i_meta = input_CurrentMetaFlags( p_item->p_meta );
*pi_mandatory &= ~i_meta; *pi_mandatory &= ~i_meta;
...@@ -85,8 +84,6 @@ int input_MetaFetch( playlist_t *p_playlist, input_item_t *p_item ) ...@@ -85,8 +84,6 @@ int input_MetaFetch( playlist_t *p_playlist, input_item_t *p_item )
struct meta_engine_t *p_me; struct meta_engine_t *p_me;
uint32_t i_mandatory, i_optional; uint32_t i_mandatory, i_optional;
assert( p_item->p_meta );
input_MetaSatisfied( p_playlist, p_item, &i_mandatory, &i_optional ); input_MetaSatisfied( p_playlist, p_item, &i_mandatory, &i_optional );
// Meta shouldn't magically appear // Meta shouldn't magically appear
assert( i_mandatory ); assert( i_mandatory );
...@@ -492,6 +489,9 @@ uint32_t input_CurrentMetaFlags( vlc_meta_t *p_meta ) ...@@ -492,6 +489,9 @@ uint32_t input_CurrentMetaFlags( vlc_meta_t *p_meta )
{ {
uint32_t i_meta = 0; uint32_t i_meta = 0;
if( !p_meta )
return 0;
#define CHECK( a, b ) \ #define CHECK( a, b ) \
if( !EMPTY_STR( vlc_meta_Get( p_meta, vlc_meta_ ## a ) ) ) \ if( !EMPTY_STR( vlc_meta_Get( p_meta, vlc_meta_ ## a ) ) ) \
i_meta |= VLC_META_ENGINE_ ## b; i_meta |= VLC_META_ENGINE_ ## b;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment