Commit 39a529ac authored by Olivier Aubert's avatar Olivier Aubert

mediacontrol_core: libvlc_media_player_get_length/time return time in ms, no need for conversion.

Additionnaly, add check for exception.
parent 2ba42a48
......@@ -398,17 +398,20 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
retval->url = libvlc_media_get_mrl( p_media, &ex );
/* TIME and LENGTH are in microseconds. We want them in ms */
retval->position = libvlc_media_player_get_time( self->p_media_player, &ex );
if( libvlc_exception_raised( &ex ) )
{
libvlc_exception_clear( &ex );
retval->position = 0;
}
retval->length = libvlc_media_player_get_length( self->p_media_player, &ex );
if( libvlc_exception_raised( &ex ) )
{
libvlc_exception_clear( &ex );
retval->length = 0;
}
retval->position = private_mediacontrol_unit_convert( self->p_media_player,
mediacontrol_MediaTime, a_key,
retval->position );
retval->length = private_mediacontrol_unit_convert( self->p_media_player,
mediacontrol_MediaTime, a_key,
retval->length );
}
return retval;
}
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