Commit 1965d962 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

access: remove access_t.psz_demux

parent 35c57312
......@@ -82,11 +82,6 @@ struct access_t
char *psz_location; /**< Location (URL with the scheme stripped) */
char *psz_filepath; /**< Local file path (if applicable) */
/* Access can fill this entry to force a demuxer
* XXX: fill it once you know for sure you will succeed
* (if you fail, this value won't be reseted */
char *psz_demux;
/* pf_read/pf_block/pf_readdir is used to read data.
* XXX A access should set one and only one of them */
ssize_t (*pf_read) ( access_t *, uint8_t *, size_t ); /* Return -1 if no data yet, 0 if no more data, else real data read */
......
......@@ -786,20 +786,6 @@ static int AccessOpen( vlc_object_t *p_this )
return VLC_EGENERIC;
}
dshow_stream_t *p_stream = p_sys->pp_streams[0];
/* Check if we need to force demuxers */
if( p_stream->i_fourcc == VLC_CODEC_DV )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "rawdv" );
}
else if( p_stream->i_fourcc == VLC_CODEC_MPGV )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "mpgv" );
}
/* Setup Access */
p_access->pf_read = NULL;
p_access->pf_block = ReadCompressed;
......
......@@ -484,8 +484,6 @@ static int Open (vlc_object_t *obj)
access->pf_block = Read;
access->pf_control = Control;
free (access->psz_demux);
access->psz_demux = strdup ("ts");
return VLC_SUCCESS;
error:
......
......@@ -522,59 +522,6 @@ connect:
goto error;
}
if( !strcmp( p_sys->psz_protocol, "ICY" ) || p_sys->b_icecast )
{
if( p_sys->psz_mime && strcasecmp( p_sys->psz_mime, "application/ogg" ) )
{
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 );
#if 0 /* Doesn't work really well because of the pre-buffering in
* shoutcast servers (the buffer content will be sent as fast as
* possible). */
p_sys->b_pace_control = false;
#endif
}
else if( !p_sys->psz_mime )
{
free( p_access->psz_demux );
/* Shoutcast */
p_access->psz_demux = strdup( "mp3" );
}
/* else probably Ogg Vorbis */
}
else if( !strcasecmp( psz_access, "unsv" ) &&
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( psz_access, "itpc" ) )
{
free( p_access->psz_demux );
p_access->psz_demux = strdup( "podcast" );
}
if( p_sys->b_reconnect ) msg_Dbg( p_access, "auto re-connect enabled" );
return VLC_SUCCESS;
......
......@@ -203,9 +203,6 @@ static int Open( vlc_object_t *p_this )
p_access->info.i_pos = (uint64_t)( 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;
error:
......
......@@ -936,9 +936,6 @@ VCDOpen ( vlc_object_t *p_this )
vcdplayer_play( p_access, itemid );
free( p_access->psz_demux );
p_access->psz_demux = strdup( "ps" );
#ifdef FIXED
if( play_single_item )
VCDFixupPlayList(p_access,p_vcd,psz_source,&itemid,play_single_item);
......
......@@ -201,8 +201,6 @@ static int Open( vlc_object_t *p_this )
return VLC_EGENERIC;
}
free( p_access->psz_demux );
p_access->psz_demux = strdup( p_sys->b_ts_format ? "ts" : "ps" );
return VLC_SUCCESS;
}
......
......@@ -54,8 +54,7 @@ char *get_path(const char *location)
* access_New:
*****************************************************************************/
access_t *access_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
const char *psz_access, const char *psz_demux,
const char *psz_location )
const char *psz_access, const char *psz_location )
{
access_t *p_access = vlc_custom_create( p_obj, sizeof (*p_access),
"access" );
......@@ -70,9 +69,7 @@ access_t *access_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
p_access->psz_access = strdup( psz_access );
p_access->psz_location = strdup( psz_location );
p_access->psz_filepath = get_path( psz_location );
p_access->psz_demux = strdup( psz_demux );
if( p_access->psz_access == NULL || p_access->psz_location == NULL
|| p_access->psz_demux == NULL )
if( p_access->psz_access == NULL || p_access->psz_location == NULL )
goto error;
msg_Dbg( p_obj, "creating access '%s' location='%s', path='%s'",
......@@ -100,7 +97,6 @@ error:
free( p_access->psz_access );
free( p_access->psz_location );
free( p_access->psz_filepath );
free( p_access->psz_demux );
vlc_object_release( p_access );
return NULL;
}
......@@ -115,7 +111,7 @@ access_t *vlc_access_NewMRL(vlc_object_t *parent, const char *mrl)
input_SplitMRL(&access, &demux, &location, &anchor, buf);
/* Both demux and anchor are ignored, since they are of no use here. */
access_t *obj = access_New(parent, NULL, access, "", location);
access_t *obj = access_New(parent, NULL, access, location);
free(buf);
return obj;
......@@ -128,7 +124,6 @@ void vlc_access_Delete(access_t *access)
free(access->psz_access);
free(access->psz_location);
free(access->psz_filepath);
free(access->psz_demux);
vlc_object_release(access);
}
......
......@@ -29,9 +29,8 @@
#include <vlc_access.h>
access_t *access_New( vlc_object_t *p_obj, input_thread_t *p_input,
const char *psz_access, const char *psz_demux,
const char *psz_path );
#define access_New( a, b, c, d, e ) access_New(VLC_OBJECT(a), b, c, d, e )
const char *psz_access, const char *psz_path );
#define access_New( a, b, c, d ) access_New(VLC_OBJECT(a), b, c, d )
char *get_path(const char *location);
......
......@@ -2286,7 +2286,7 @@ static int InputSourceInit( input_thread_t *p_input,
/* */
access_t *p_access = access_New( p_input, p_input,
psz_access, psz_demux, psz_path );
psz_access, psz_path );
if( p_access == NULL )
{
msg_Err( p_input, "open of `%s' failed", psz_mrl );
......@@ -2298,8 +2298,7 @@ static int InputSourceInit( input_thread_t *p_input,
}
/* Access-forced demuxer (PARENTAL ADVISORY: EXPLICIT HACK) */
if( !psz_demux[0] || !strcasecmp( psz_demux, "any" ) )
psz_demux = p_access->psz_demux;
#warning FIXME: parse content type
/* Create the stream_t */
stream_t *p_stream = stream_AccessNew( p_access );
......
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