Commit 43f58feb authored by Rafaël Carré's avatar Rafaël Carré

Do not leak psz_demux

parent 2c73e8cf
...@@ -166,6 +166,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -166,6 +166,7 @@ static int Open( vlc_object_t *p_this )
p_access->pf_control= Control; p_access->pf_control= Control;
/* Force a demux */ /* Force a demux */
free( p_access->psz_demux );
p_access->psz_demux = strdup( "directory" ); p_access->psz_demux = strdup( "directory" );
return VLC_SUCCESS; return VLC_SUCCESS;
......
...@@ -657,11 +657,13 @@ static int AccessOpen( vlc_object_t *p_this ) ...@@ -657,11 +657,13 @@ static int AccessOpen( vlc_object_t *p_this )
p_stream->i_fourcc == VLC_FOURCC('d','v','s','d') || p_stream->i_fourcc == VLC_FOURCC('d','v','s','d') ||
p_stream->i_fourcc == VLC_FOURCC('d','v','h','d') ) p_stream->i_fourcc == VLC_FOURCC('d','v','h','d') )
{ {
free( p_access->psz_demux );
p_access->psz_demux = strdup( "rawdv" ); p_access->psz_demux = strdup( "rawdv" );
} }
else if( p_stream->i_fourcc == VLC_FOURCC('m','p','2','v') ) else if( p_stream->i_fourcc == VLC_FOURCC('m','p','2','v') )
{ {
p_access->psz_demux = "mpgv"; free( p_access->psz_demux );
p_access->psz_demux = strdup( "mpgv" );
} }
} }
......
...@@ -340,8 +340,13 @@ static block_t *Block( access_t *p_access ) ...@@ -340,8 +340,13 @@ static block_t *Block( access_t *p_access )
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
block_t *p_block = NULL; block_t *p_block = NULL;
// if( !p_access->psz_demux ) #if 0
// p_access->psz_demux = strdup( "rawdv" ); if( !p_access->psz_demux )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "rawdv" );
}
#endif
vlc_mutex_lock( &p_sys->lock ); vlc_mutex_lock( &p_sys->lock );
p_block = p_sys->p_frame; p_block = p_sys->p_frame;
......
...@@ -454,12 +454,21 @@ connect: ...@@ -454,12 +454,21 @@ connect:
{ {
if( !strcasecmp( p_sys->psz_mime, "video/nsv" ) || if( !strcasecmp( p_sys->psz_mime, "video/nsv" ) ||
!strcasecmp( p_sys->psz_mime, "video/nsa" ) ) !strcasecmp( p_sys->psz_mime, "video/nsa" ) )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "nsv" ); p_access->psz_demux = strdup( "nsv" );
}
else if( !strcasecmp( p_sys->psz_mime, "audio/aac" ) || else if( !strcasecmp( p_sys->psz_mime, "audio/aac" ) ||
!strcasecmp( p_sys->psz_mime, "audio/aacp" ) ) !strcasecmp( p_sys->psz_mime, "audio/aacp" ) )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "m4a" ); p_access->psz_demux = strdup( "m4a" );
}
else if( !strcasecmp( p_sys->psz_mime, "audio/mpeg" ) ) else if( !strcasecmp( p_sys->psz_mime, "audio/mpeg" ) )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "mp3" ); p_access->psz_demux = strdup( "mp3" );
}
msg_Info( p_access, "Raw-audio server found, %s demuxer selected", msg_Info( p_access, "Raw-audio server found, %s demuxer selected",
p_access->psz_demux ); p_access->psz_demux );
...@@ -472,8 +481,9 @@ connect: ...@@ -472,8 +481,9 @@ connect:
} }
else if( !p_sys->psz_mime ) else if( !p_sys->psz_mime )
{ {
/* Shoutcast */ free( p_access->psz_demux );
p_access->psz_demux = strdup( "mp3" ); /* Shoutcast */
p_access->psz_demux = strdup( "mp3" );
} }
/* else probably Ogg Vorbis */ /* else probably Ogg Vorbis */
} }
...@@ -481,17 +491,22 @@ connect: ...@@ -481,17 +491,22 @@ connect:
p_sys->psz_mime && p_sys->psz_mime &&
!strcasecmp( p_sys->psz_mime, "misc/ultravox" ) ) !strcasecmp( p_sys->psz_mime, "misc/ultravox" ) )
{ {
free( p_access->psz_demux );
/* Grrrr! detect ultravox server and force NSV demuxer */ /* Grrrr! detect ultravox server and force NSV demuxer */
p_access->psz_demux = strdup( "nsv" ); p_access->psz_demux = strdup( "nsv" );
} }
else if( !strcmp( p_access->psz_access, "itpc" ) ) else if( !strcmp( p_access->psz_access, "itpc" ) )
{ {
free( p_access->psz_demux );
p_access->psz_demux = strdup( "podcast" ); p_access->psz_demux = strdup( "podcast" );
} }
else if( p_sys->psz_mime && else if( p_sys->psz_mime &&
!strncasecmp( p_sys->psz_mime, "application/xspf+xml", 20 ) && !strncasecmp( p_sys->psz_mime, "application/xspf+xml", 20 ) &&
( memchr( " ;\t", p_sys->psz_mime[20], 4 ) != NULL ) ) ( memchr( " ;\t", p_sys->psz_mime[20], 4 ) != NULL ) )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "xspf-open" ); p_access->psz_demux = strdup( "xspf-open" );
}
if( p_sys->b_reconnect ) msg_Dbg( p_access, "auto re-connect enabled" ); if( p_sys->b_reconnect ) msg_Dbg( p_access, "auto re-connect enabled" );
......
...@@ -743,16 +743,19 @@ static block_t *BlockChoose( access_t *p_access ) ...@@ -743,16 +743,19 @@ static block_t *BlockChoose( access_t *p_access )
{ {
case 33: case 33:
msg_Dbg( p_access, "detected MPEG2 TS over RTP" ); msg_Dbg( p_access, "detected MPEG2 TS over RTP" );
free( p_access->psz_demux );
p_access->psz_demux = strdup( "ts" ); p_access->psz_demux = strdup( "ts" );
break; break;
case 14: case 14:
msg_Dbg( p_access, "detected MPEG Audio over RTP" ); msg_Dbg( p_access, "detected MPEG Audio over RTP" );
free( p_access->psz_demux );
p_access->psz_demux = strdup( "mpga" ); p_access->psz_demux = strdup( "mpga" );
break; break;
case 32: case 32:
msg_Dbg( p_access, "detected MPEG Video over RTP" ); msg_Dbg( p_access, "detected MPEG Video over RTP" );
free( p_access->psz_demux );
p_access->psz_demux = strdup( "mpgv" ); p_access->psz_demux = strdup( "mpgv" );
break; break;
......
...@@ -211,6 +211,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -211,6 +211,7 @@ static int Open( vlc_object_t *p_this )
p_access->info.i_pos = ( p_sys->i_sector - p_sys->p_sectors[1+i_title] ) * p_access->info.i_pos = ( p_sys->i_sector - p_sys->p_sectors[1+i_title] ) *
VCD_DATA_SIZE; VCD_DATA_SIZE;
free( p_access->psz_demux );
p_access->psz_demux = strdup( "ps" ); p_access->psz_demux = strdup( "ps" );
return VLC_SUCCESS; return VLC_SUCCESS;
......
...@@ -957,6 +957,7 @@ VCDOpen ( vlc_object_t *p_this ) ...@@ -957,6 +957,7 @@ VCDOpen ( vlc_object_t *p_this )
vcdplayer_play( p_access, itemid ); vcdplayer_play( p_access, itemid );
free( p_access->psz_demux );
p_access->psz_demux = strdup( "ps" ); p_access->psz_demux = strdup( "ps" );
#if FIXED #if FIXED
......
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