@ -52,7 +52,6 @@ static int rtmp_close(URLContext *s)
RTMP * r = s - > priv_data ;
RTMP * r = s - > priv_data ;
RTMP_Close ( r ) ;
RTMP_Close ( r ) ;
av_free ( r ) ;
return 0 ;
return 0 ;
}
}
@ -70,13 +69,9 @@ static int rtmp_close(URLContext *s)
*/
*/
static int rtmp_open ( URLContext * s , const char * uri , int flags )
static int rtmp_open ( URLContext * s , const char * uri , int flags )
{
{
RTMP * r ;
RTMP * r = s - > priv_data ;
int rc ;
int rc ;
r = av_mallocz ( sizeof ( RTMP ) ) ;
if ( ! r )
return AVERROR ( ENOMEM ) ;
switch ( av_log_get_level ( ) ) {
switch ( av_log_get_level ( ) ) {
default :
default :
case AV_LOG_FATAL : rc = RTMP_LOGCRIT ; break ;
case AV_LOG_FATAL : rc = RTMP_LOGCRIT ; break ;
@ -103,11 +98,9 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
goto fail ;
goto fail ;
}
}
s - > priv_data = r ;
s - > is_streamed = 1 ;
s - > is_streamed = 1 ;
return 0 ;
return 0 ;
fail :
fail :
av_free ( r ) ;
return rc ;
return rc ;
}
}
@ -167,7 +160,8 @@ URLProtocol ff_rtmp_protocol = {
. url_close = rtmp_close ,
. url_close = rtmp_close ,
. url_read_pause = rtmp_read_pause ,
. url_read_pause = rtmp_read_pause ,
. url_read_seek = rtmp_read_seek ,
. url_read_seek = rtmp_read_seek ,
. url_get_file_handle = rtmp_get_file_handle
. url_get_file_handle = rtmp_get_file_handle ,
. priv_data_size = sizeof ( RTMP ) ,
} ;
} ;
URLProtocol ff_rtmpt_protocol = {
URLProtocol ff_rtmpt_protocol = {
@ -178,7 +172,8 @@ URLProtocol ff_rtmpt_protocol = {
. url_close = rtmp_close ,
. url_close = rtmp_close ,
. url_read_pause = rtmp_read_pause ,
. url_read_pause = rtmp_read_pause ,
. url_read_seek = rtmp_read_seek ,
. url_read_seek = rtmp_read_seek ,
. url_get_file_handle = rtmp_get_file_handle
. url_get_file_handle = rtmp_get_file_handle ,
. priv_data_size = sizeof ( RTMP ) ,
} ;
} ;
URLProtocol ff_rtmpe_protocol = {
URLProtocol ff_rtmpe_protocol = {
@ -189,7 +184,8 @@ URLProtocol ff_rtmpe_protocol = {
. url_close = rtmp_close ,
. url_close = rtmp_close ,
. url_read_pause = rtmp_read_pause ,
. url_read_pause = rtmp_read_pause ,
. url_read_seek = rtmp_read_seek ,
. url_read_seek = rtmp_read_seek ,
. url_get_file_handle = rtmp_get_file_handle
. url_get_file_handle = rtmp_get_file_handle ,
. priv_data_size = sizeof ( RTMP ) ,
} ;
} ;
URLProtocol ff_rtmpte_protocol = {
URLProtocol ff_rtmpte_protocol = {
@ -200,7 +196,8 @@ URLProtocol ff_rtmpte_protocol = {
. url_close = rtmp_close ,
. url_close = rtmp_close ,
. url_read_pause = rtmp_read_pause ,
. url_read_pause = rtmp_read_pause ,
. url_read_seek = rtmp_read_seek ,
. url_read_seek = rtmp_read_seek ,
. url_get_file_handle = rtmp_get_file_handle
. url_get_file_handle = rtmp_get_file_handle ,
. priv_data_size = sizeof ( RTMP ) ,
} ;
} ;
URLProtocol ff_rtmps_protocol = {
URLProtocol ff_rtmps_protocol = {
@ -211,5 +208,6 @@ URLProtocol ff_rtmps_protocol = {
. url_close = rtmp_close ,
. url_close = rtmp_close ,
. url_read_pause = rtmp_read_pause ,
. url_read_pause = rtmp_read_pause ,
. url_read_seek = rtmp_read_seek ,
. url_read_seek = rtmp_read_seek ,
. url_get_file_handle = rtmp_get_file_handle
. url_get_file_handle = rtmp_get_file_handle ,
. priv_data_size = sizeof ( RTMP ) ,
} ;
} ;