Commit 37205f44 authored by Filip Roséen's avatar Filip Roséen Committed by Thomas Guillem

lib/media_player: libvlc_get_track_description: simplify allocations

There is no need for the explicit cast, nor do we need to state the
name of the object's type for which we are allocating memory. These
changes should make it easier to read, and maintain, the function.
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent 59bc6a45
......@@ -1788,8 +1788,7 @@ libvlc_track_description_t *
if( val_list.p_list->i_count <= 0 )
goto end;
p_track_description = ( libvlc_track_description_t * )
malloc( sizeof( libvlc_track_description_t ) );
p_track_description = malloc( sizeof *p_track_description );
if ( !p_track_description )
{
libvlc_printerr( "Not enough memory" );
......@@ -1801,8 +1800,7 @@ libvlc_track_description_t *
{
if( !p_actual )
{
p_actual = ( libvlc_track_description_t * )
malloc( sizeof( libvlc_track_description_t ) );
p_actual = malloc( sizeof *p_actual );
if ( !p_actual )
{
libvlc_track_description_list_release( p_track_description );
......
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