Commit f1dd5a85 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Codingstyle fixes

parent 19713fc4
......@@ -57,12 +57,10 @@
#define RAISE( c, m ) exception->code = c; \
exception->message = strdup(m);
vlc_t * vlc_current_object( int );
mediacontrol_Instance* mediacontrol_new_from_object( int vlc_object_id,
mediacontrol_Exception *exception )
{
mediacontrol_Instance* retval;
mediacontrol_Instance* retval = NULL;
vlc_object_t *p_vlc;
vlc_object_t *p_object;
......@@ -106,7 +104,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
const mediacontrol_PositionKey a_key,
mediacontrol_Exception *exception )
{
mediacontrol_Position* retval;
mediacontrol_Position* retval = NULL;
vlc_value_t val;
input_thread_t * p_input = self->p_playlist->p_input;
......@@ -154,18 +152,16 @@ mediacontrol_set_media_position( mediacontrol_Instance *self,
if( ! p_input )
{
RAISE( mediacontrol_InternalException, "No input thread." );
return;
}
if( !var_GetBool( p_input, "seekable" ) )
else if( !var_GetBool( p_input, "seekable" ) )
{
RAISE( mediacontrol_InvalidPosition, "Stream not seekable" );
return;
}
else
{
val.i_time = mediacontrol_position2microsecond( p_input, a_position );
var_Set( p_input, "time", val );
return;
}
}
/* Starts playing a stream */
......@@ -197,8 +193,11 @@ mediacontrol_start( mediacontrol_Instance *self,
{
int i_index;
int i_from;
char * psz_from = ( char * )malloc( 20 * sizeof( char ) );
char *psz_from = NULL;
psz_from = ( char * )malloc( 20 * sizeof( char ) );
if( psz_from )
{
i_from = mediacontrol_position2microsecond( p_playlist->p_input, a_position ) / 1000000;
i_index = p_playlist->i_index;
......@@ -212,9 +211,9 @@ mediacontrol_start( mediacontrol_Instance *self,
snprintf( psz_from, 20, "start-time=%i", i_from );
playlist_ItemAddOption( p_playlist->pp_items[i_index], psz_from );
free( psz_from );
}
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Play( p_playlist );
}
else
......@@ -222,8 +221,6 @@ mediacontrol_start( mediacontrol_Instance *self,
RAISE( mediacontrol_PlaylistException, "Empty playlist." );
vlc_mutex_unlock( &p_playlist->object_lock );
}
return;
}
void
......@@ -243,8 +240,6 @@ mediacontrol_pause( mediacontrol_Instance *self,
{
RAISE( mediacontrol_InternalException, "No input" );
}
return;
}
void
......@@ -276,9 +271,8 @@ mediacontrol_stop( mediacontrol_Instance *self,
if( !self->p_playlist )
{
RAISE( mediacontrol_PlaylistException, "No playlist" );
return;
}
else
playlist_Stop( self->p_playlist );
}
......@@ -295,9 +289,8 @@ mediacontrol_playlist_add_item( mediacontrol_Instance *self,
if( !self->p_playlist )
{
RAISE( mediacontrol_InternalException, "No playlist" );
return;
}
else
playlist_Add( self->p_playlist, psz_file, psz_file , PLAYLIST_INSERT,
PLAYLIST_END );
}
......@@ -310,12 +303,9 @@ mediacontrol_playlist_next_item( mediacontrol_Instance *self,
if ( !self->p_playlist )
{
RAISE( mediacontrol_InternalException, "No playlist" );
return;
}
else
playlist_Next( self->p_playlist );
return;
}
void
......@@ -326,19 +316,16 @@ mediacontrol_playlist_clear( mediacontrol_Instance *self,
if( !self->p_playlist )
{
RAISE( mediacontrol_PlaylistException, "No playlist" );
return;
}
else
playlist_Clear( self->p_playlist );
return;
}
mediacontrol_PlaylistSeq *
mediacontrol_playlist_get_list( mediacontrol_Instance *self,
mediacontrol_Exception *exception )
{
mediacontrol_PlaylistSeq *retval;
mediacontrol_PlaylistSeq *retval = NULL;
int i_index;
playlist_t * p_playlist = self->p_playlist;
int i_playlist_size;
......@@ -373,7 +360,7 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
mediacontrol_PositionKey a_key,
mediacontrol_Exception *exception )
{
mediacontrol_StreamInformation *retval;
mediacontrol_StreamInformation *retval = NULL;
input_thread_t *p_input = self->p_playlist->p_input;
vlc_value_t val;
......
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