static int Open ( vlc_object_t * );
static void Close( vlc_object_t * );
-vlc_module_begin();
- set_description( N_("RTMP input") );
- set_shortname( N_("RTMP") );
- set_category( CAT_INPUT );
- set_subcategory( SUBCAT_INPUT_ACCESS );
+vlc_module_begin ()
+ set_description( N_("RTMP input") )
+ set_shortname( N_("RTMP") )
+ set_category( CAT_INPUT )
+ set_subcategory( SUBCAT_INPUT_ACCESS )
add_integer( "rtmp-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT,
CACHING_LONGTEXT, true );
- set_capability( "access", 0 );
- set_callbacks( Open, Close );
- add_shortcut( "rtmp" );
-vlc_module_end();
+ set_capability( "access", 0 )
+ set_callbacks( Open, Close )
+ add_shortcut( "rtmp" )
+vlc_module_end ()
/*****************************************************************************
}
length_path = strlen( p_sys->p_thread->url.psz_path );
- length_media_name = strlen( strrchr( p_sys->p_thread->url.psz_path, '/' ) ) - 1;
+ char* psz_tmp = strrchr( p_sys->p_thread->url.psz_path, '/' );
+ if( !psz_tmp )
+ goto error;
+ length_media_name = strlen( psz_tmp ) - 1;
p_sys->p_thread->psz_application = strndup( p_sys->p_thread->url.psz_path + 1, length_path - length_media_name - 2 );
p_sys->p_thread->psz_media = strdup( p_sys->p_thread->url.psz_path + ( length_path - length_media_name ) );
p_sys->p_thread->p_base_object = p_this;
- vlc_cond_init( p_sys->p_thread, &p_sys->p_thread->wait );
+ vlc_cond_init( &p_sys->p_thread->wait );
vlc_mutex_init( &p_sys->p_thread->lock );
}
if( vlc_thread_create( p_sys->p_thread, "rtmp control thread", ThreadControl,
- VLC_THREAD_PRIORITY_INPUT, false ) )
+ VLC_THREAD_PRIORITY_INPUT ) )
{
msg_Err( p_access, "cannot spawn rtmp control thread" );
goto error2;
/* p_sys->p_thread->b_die = true;*/
vlc_object_kill( p_sys->p_thread );
block_FifoWake( p_sys->p_thread->p_fifo_input );
- block_FifoWake( p_sys->p_thread->p_empty_blocks );
vlc_thread_join( p_sys->p_thread );
{
rtmp_control_thread_t *p_thread = (rtmp_control_thread_t *) p_this;
rtmp_packet_t *rtmp_packet;
+ int canc = vlc_savecancel ();
rtmp_init_handler( p_thread->rtmp_handler );
block_FifoWake( p_thread->p_fifo_input );
}
}
+ vlc_restorecancel (canc);
return NULL;
}