Commit 8f556b71 authored by JP Dinger's avatar JP Dinger

Shore up code and remove early returns.

parent 456bc399
...@@ -303,33 +303,27 @@ static void Close( vlc_object_t *p_this ) ...@@ -303,33 +303,27 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************/ *****************************************************************************/
static int Control( access_t *p_access, int i_query, va_list args ) static int Control( access_t *p_access, int i_query, va_list args )
{ {
access_sys_t *p_sys = p_access->p_sys;
bool *pb_bool;
int64_t *pi_64;
switch( i_query ) switch( i_query )
{ {
/* */ /* */
case ACCESS_CAN_PAUSE: case ACCESS_CAN_PAUSE:
pb_bool = (bool*)va_arg( args, bool* ); *va_arg( args, bool* ) = true;
*pb_bool = true;
break; break;
case ACCESS_CAN_SEEK: case ACCESS_CAN_SEEK:
case ACCESS_CAN_FASTSEEK: case ACCESS_CAN_FASTSEEK:
case ACCESS_CAN_CONTROL_PACE: case ACCESS_CAN_CONTROL_PACE:
pb_bool = (bool*)va_arg( args, bool* ); *va_arg( args, bool* ) = false;
*pb_bool = false;
break; break;
case ACCESS_GET_PTS_DELAY: case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * ); *va_arg( args, int64_t * )
*pi_64 = (int64_t)var_GetInteger( p_access, "dv-caching" ) * 1000; = (int64_t)var_GetInteger( p_access, "dv-caching" ) * 1000;
break; break;
/* */ /* */
case ACCESS_SET_PAUSE_STATE: case ACCESS_SET_PAUSE_STATE:
AVCPause( p_access, p_sys->i_node ); AVCPause( p_access, p_access->p_sys->i_node );
break; break;
case ACCESS_GET_TITLE_INFO: case ACCESS_GET_TITLE_INFO:
...@@ -642,10 +636,8 @@ static int AVCPlay( access_t *p_access, int phyID ) ...@@ -642,10 +636,8 @@ static int AVCPlay( access_t *p_access, int phyID )
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
msg_Dbg( p_access, "send play command over Digital Video control channel" ); msg_Dbg( p_access, "send play command over Digital Video control channel" );
if( !p_sys->p_avc1394 )
return 0;
if( phyID >= 0 ) if( p_sys->p_avc1394 && phyID >= 0 )
{ {
if( !avc1394_vcr_is_recording( p_sys->p_avc1394, phyID ) && if( !avc1394_vcr_is_recording( p_sys->p_avc1394, phyID ) &&
avc1394_vcr_is_playing( p_sys->p_avc1394, phyID ) != AVC1394_VCR_OPERAND_PLAY_FORWARD ) avc1394_vcr_is_playing( p_sys->p_avc1394, phyID ) != AVC1394_VCR_OPERAND_PLAY_FORWARD )
...@@ -658,10 +650,7 @@ static int AVCPause( access_t *p_access, int phyID ) ...@@ -658,10 +650,7 @@ static int AVCPause( access_t *p_access, int phyID )
{ {
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
if( !p_sys->p_avc1394 ) if( p_sys->p_avc1394 && phyID >= 0 )
return 0;
if( phyID >= 0 )
{ {
if( !avc1394_vcr_is_recording( p_sys->p_avc1394, phyID ) && if( !avc1394_vcr_is_recording( p_sys->p_avc1394, phyID ) &&
( avc1394_vcr_is_playing( p_sys->p_avc1394, phyID ) != AVC1394_VCR_OPERAND_PLAY_FORWARD_PAUSE ) ) ( avc1394_vcr_is_playing( p_sys->p_avc1394, phyID ) != AVC1394_VCR_OPERAND_PLAY_FORWARD_PAUSE ) )
...@@ -676,10 +665,8 @@ static int AVCStop( access_t *p_access, int phyID ) ...@@ -676,10 +665,8 @@ static int AVCStop( access_t *p_access, int phyID )
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
msg_Dbg( p_access, "closing Digital Video control channel" ); msg_Dbg( p_access, "closing Digital Video control channel" );
if( !p_sys->p_avc1394 )
return 0;
if ( phyID >= 0 ) if ( p_sys->p_avc1394 && phyID >= 0 )
avc1394_vcr_stop( p_sys->p_avc1394, phyID ); avc1394_vcr_stop( p_sys->p_avc1394, phyID );
return 0; return 0;
......
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