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 )
p_access->pf_control= Control;
/* Force a demux */
free( p_access->psz_demux );
p_access->psz_demux = strdup( "directory" );
return VLC_SUCCESS;
......
......@@ -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','h','d') )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "rawdv" );
}
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 )
access_sys_t *p_sys = p_access->p_sys;
block_t *p_block = NULL;
// if( !p_access->psz_demux )
// p_access->psz_demux = strdup( "rawdv" );
#if 0
if( !p_access->psz_demux )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "rawdv" );
}
#endif
vlc_mutex_lock( &p_sys->lock );
p_block = p_sys->p_frame;
......
......@@ -454,12 +454,21 @@ connect:
{
if( !strcasecmp( p_sys->psz_mime, "video/nsv" ) ||
!strcasecmp( p_sys->psz_mime, "video/nsa" ) )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "nsv" );
}
else if( !strcasecmp( p_sys->psz_mime, "audio/aac" ) ||
!strcasecmp( p_sys->psz_mime, "audio/aacp" ) )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "m4a" );
}
else if( !strcasecmp( p_sys->psz_mime, "audio/mpeg" ) )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "mp3" );
}
msg_Info( p_access, "Raw-audio server found, %s demuxer selected",
p_access->psz_demux );
......@@ -472,8 +481,9 @@ connect:
}
else if( !p_sys->psz_mime )
{
/* Shoutcast */
p_access->psz_demux = strdup( "mp3" );
free( p_access->psz_demux );
/* Shoutcast */
p_access->psz_demux = strdup( "mp3" );
}
/* else probably Ogg Vorbis */
}
......@@ -481,17 +491,22 @@ connect:
p_sys->psz_mime &&
!strcasecmp( p_sys->psz_mime, "misc/ultravox" ) )
{
free( p_access->psz_demux );
/* Grrrr! detect ultravox server and force NSV demuxer */
p_access->psz_demux = strdup( "nsv" );
}
else if( !strcmp( p_access->psz_access, "itpc" ) )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "podcast" );
}
else if( p_sys->psz_mime &&
!strncasecmp( p_sys->psz_mime, "application/xspf+xml", 20 ) &&
( memchr( " ;\t", p_sys->psz_mime[20], 4 ) != NULL ) )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "xspf-open" );
}
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 )
{
case 33:
msg_Dbg( p_access, "detected MPEG2 TS over RTP" );
free( p_access->psz_demux );
p_access->psz_demux = strdup( "ts" );
break;
case 14:
msg_Dbg( p_access, "detected MPEG Audio over RTP" );
free( p_access->psz_demux );
p_access->psz_demux = strdup( "mpga" );
break;
case 32:
msg_Dbg( p_access, "detected MPEG Video over RTP" );
free( p_access->psz_demux );
p_access->psz_demux = strdup( "mpgv" );
break;
......
......@@ -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] ) *
VCD_DATA_SIZE;
free( p_access->psz_demux );
p_access->psz_demux = strdup( "ps" );
return VLC_SUCCESS;
......
......@@ -957,6 +957,7 @@ VCDOpen ( vlc_object_t *p_this )
vcdplayer_play( p_access, itemid );
free( p_access->psz_demux );
p_access->psz_demux = strdup( "ps" );
#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