Commit 3484d8f0 authored by Rémi Duraffort's avatar Rémi Duraffort

mmsh: factorize.

parent 09dcfc63
...@@ -147,21 +147,14 @@ int MMSHOpen( access_t *p_access ) ...@@ -147,21 +147,14 @@ int MMSHOpen( access_t *p_access )
( *p_sys->url.psz_host == '\0' ) ) ( *p_sys->url.psz_host == '\0' ) )
{ {
msg_Err( p_access, "invalid host" ); msg_Err( p_access, "invalid host" );
vlc_UrlClean( &p_sys->proxy ); goto error;
vlc_UrlClean( &p_sys->url );
free( p_sys );
return VLC_EGENERIC;
} }
if( p_sys->url.i_port <= 0 ) if( p_sys->url.i_port <= 0 )
p_sys->url.i_port = 80; p_sys->url.i_port = 80;
if( Describe( p_access, &psz_location ) ) if( Describe( p_access, &psz_location ) )
{ goto error;
vlc_UrlClean( &p_sys->proxy );
vlc_UrlClean( &p_sys->url );
free( p_sys );
return VLC_EGENERIC;
}
/* Handle redirection */ /* Handle redirection */
if( psz_location && *psz_location ) if( psz_location && *psz_location )
{ {
...@@ -172,11 +165,8 @@ int MMSHOpen( access_t *p_access ) ...@@ -172,11 +165,8 @@ int MMSHOpen( access_t *p_access )
if( !p_input ) if( !p_input )
{ {
vlc_UrlClean( &p_sys->proxy );
vlc_UrlClean( &p_sys->url );
free( p_sys );
free( psz_location ); free( psz_location );
return VLC_EGENERIC; goto error;
} }
/** \bug we do not autodelete here */ /** \bug we do not autodelete here */
p_new_loc = input_item_New( p_access, psz_location, psz_location ); p_new_loc = input_item_New( p_access, psz_location, psz_location );
...@@ -197,10 +187,7 @@ int MMSHOpen( access_t *p_access ) ...@@ -197,10 +187,7 @@ int MMSHOpen( access_t *p_access )
{ {
msg_Err( p_access, "cannot start stream" ); msg_Err( p_access, "cannot start stream" );
free( p_sys->p_header ); free( p_sys->p_header );
vlc_UrlClean( &p_sys->proxy ); goto error;
vlc_UrlClean( &p_sys->url );
free( p_sys );
return VLC_EGENERIC;
} }
if( !p_sys->b_broadcast ) if( !p_sys->b_broadcast )
...@@ -209,6 +196,12 @@ int MMSHOpen( access_t *p_access ) ...@@ -209,6 +196,12 @@ int MMSHOpen( access_t *p_access )
} }
return VLC_SUCCESS; return VLC_SUCCESS;
error:
vlc_UrlClean( &p_sys->proxy );
vlc_UrlClean( &p_sys->url );
free( p_sys );
return VLC_EGENERIC;
} }
/***************************************************************************** /*****************************************************************************
...@@ -220,7 +213,7 @@ void MMSHClose ( access_t *p_access ) ...@@ -220,7 +213,7 @@ void MMSHClose ( access_t *p_access )
Stop( p_access ); Stop( p_access );
free( p_sys->p_header ); free( p_sys->p_header );
vlc_UrlClean( &p_sys->proxy ); vlc_UrlClean( &p_sys->proxy );
vlc_UrlClean( &p_sys->url ); vlc_UrlClean( &p_sys->url );
......
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