Commit 33e3934e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

- do not check "always true" case

- fix a small memory leak
parent ba9476d4
...@@ -271,8 +271,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -271,8 +271,6 @@ static int Open( vlc_object_t *p_this )
} }
/* fix or warn of incompatible couple */ /* fix or warn of incompatible couple */
if( psz_mux && psz_access )
{
if( !strncmp( psz_access, "mmsh", 4 ) && if( !strncmp( psz_access, "mmsh", 4 ) &&
strncmp( psz_mux, "asfh", 4 ) ) strncmp( psz_mux, "asfh", 4 ) )
{ {
...@@ -281,12 +279,14 @@ static int Open( vlc_object_t *p_this ) ...@@ -281,12 +279,14 @@ static int Open( vlc_object_t *p_this )
msg_Warn( p_stream, "fixing to mmsh/asfh" ); msg_Warn( p_stream, "fixing to mmsh/asfh" );
if( p ) if( p )
{ {
/* -> a little memleak but ... */ if( asprintf( &p, "asfh%s", p ) == -1 )
psz_mux = malloc( strlen( "asfh" ) + strlen( p ) + 1); p = NULL;
sprintf( psz_mux, "asfh%s", p ); free( psz_mux );
psz_mux = p;
} }
else else
{ {
free( psz_mux );
psz_mux = strdup("asfh"); psz_mux = strdup("asfh");
} }
} }
...@@ -294,7 +294,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -294,7 +294,7 @@ static int Open( vlc_object_t *p_this )
!strncmp( psz_access, "udp", 3 ) ) && !strncmp( psz_access, "udp", 3 ) ) &&
strncmp( psz_mux, "ts", 2 ) ) strncmp( psz_mux, "ts", 2 ) )
{ {
msg_Err( p_stream, "for now udp and rtp are only valid with TS" ); msg_Err( p_stream, "UDP and RTP are only valid with TS" );
} }
else if( strncmp( psz_access, "file", 4 ) && else if( strncmp( psz_access, "file", 4 ) &&
( !strncmp( psz_mux, "mov", 3 ) || ( !strncmp( psz_mux, "mov", 3 ) ||
...@@ -302,7 +302,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -302,7 +302,6 @@ static int Open( vlc_object_t *p_this )
{ {
msg_Err( p_stream, "mov and mp4 work only with file output" ); msg_Err( p_stream, "mov and mp4 work only with file output" );
} }
}
msg_Dbg( p_this, "using `%s/%s://%s'", psz_access, psz_mux, psz_url ); msg_Dbg( p_this, "using `%s/%s://%s'", psz_access, psz_mux, psz_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