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

libvlc: Properly raise an exception if something goes wrong in...

libvlc: Properly raise an exception if something goes wrong in libvlc_media_get_duration and libvlc_media_is_preparsed.
parent 303e9b54
...@@ -519,14 +519,13 @@ libvlc_media_get_duration( libvlc_media_t * p_md, ...@@ -519,14 +519,13 @@ libvlc_media_get_duration( libvlc_media_t * p_md,
{ {
VLC_UNUSED(p_e); VLC_UNUSED(p_e);
if( p_md && p_md->p_input_item) if( !p_md || !p_md->p_input_item)
{
return input_item_GetDuration( p_md->p_input_item );
}
else
{ {
libvlc_exception_raise( p_e, "No input item" );
return -1; return -1;
} }
return input_item_GetDuration( p_md->p_input_item );
} }
/************************************************************************** /**************************************************************************
...@@ -538,14 +537,13 @@ libvlc_media_is_preparsed( libvlc_media_t * p_md, ...@@ -538,14 +537,13 @@ libvlc_media_is_preparsed( libvlc_media_t * p_md,
{ {
VLC_UNUSED(p_e); VLC_UNUSED(p_e);
if( p_md && p_md->p_input_item) if( !p_md || !p_md->p_input_item)
{
return input_item_IsPreparsed( p_md->p_input_item );
}
else
{ {
libvlc_exception_raise( p_e, "No input item" );
return false; return false;
} }
return input_item_IsPreparsed( p_md->p_input_item );
} }
/************************************************************************** /**************************************************************************
......
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