Skip to content

Commit 1965d96

Browse files
author
Rémi Denis-Courmont
committed
access: remove access_t.psz_demux
1 parent 35c5731 commit 1965d96

File tree

10 files changed

+7
-96
lines changed

10 files changed

+7
-96
lines changed

include/vlc_access.h

-5
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ struct access_t
8282
char *psz_location; /**< Location (URL with the scheme stripped) */
8383
char *psz_filepath; /**< Local file path (if applicable) */
8484

85-
/* Access can fill this entry to force a demuxer
86-
* XXX: fill it once you know for sure you will succeed
87-
* (if you fail, this value won't be reseted */
88-
char *psz_demux;
89-
9085
/* pf_read/pf_block/pf_readdir is used to read data.
9186
* XXX A access should set one and only one of them */
9287
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 */

modules/access/dshow/dshow.cpp

-14
Original file line numberDiff line numberDiff line change
@@ -786,20 +786,6 @@ static int AccessOpen( vlc_object_t *p_this )
786786
return VLC_EGENERIC;
787787
}
788788

789-
dshow_stream_t *p_stream = p_sys->pp_streams[0];
790-
791-
/* Check if we need to force demuxers */
792-
if( p_stream->i_fourcc == VLC_CODEC_DV )
793-
{
794-
free( p_access->psz_demux );
795-
p_access->psz_demux = strdup( "rawdv" );
796-
}
797-
else if( p_stream->i_fourcc == VLC_CODEC_MPGV )
798-
{
799-
free( p_access->psz_demux );
800-
p_access->psz_demux = strdup( "mpgv" );
801-
}
802-
803789
/* Setup Access */
804790
p_access->pf_read = NULL;
805791
p_access->pf_block = ReadCompressed;

modules/access/dtv/access.c

-2
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,6 @@ static int Open (vlc_object_t *obj)
484484

485485
access->pf_block = Read;
486486
access->pf_control = Control;
487-
free (access->psz_demux);
488-
access->psz_demux = strdup ("ts");
489487
return VLC_SUCCESS;
490488

491489
error:

modules/access/http.c

-53
Original file line numberDiff line numberDiff line change
@@ -522,59 +522,6 @@ static int OpenRedirected( vlc_object_t *p_this, const char *psz_access,
522522
goto error;
523523
}
524524

525-
if( !strcmp( p_sys->psz_protocol, "ICY" ) || p_sys->b_icecast )
526-
{
527-
if( p_sys->psz_mime && strcasecmp( p_sys->psz_mime, "application/ogg" ) )
528-
{
529-
if( !strcasecmp( p_sys->psz_mime, "video/nsv" ) ||
530-
!strcasecmp( p_sys->psz_mime, "video/nsa" ) )
531-
{
532-
free( p_access->psz_demux );
533-
p_access->psz_demux = strdup( "nsv" );
534-
}
535-
else if( !strcasecmp( p_sys->psz_mime, "audio/aac" ) ||
536-
!strcasecmp( p_sys->psz_mime, "audio/aacp" ) )
537-
{
538-
free( p_access->psz_demux );
539-
p_access->psz_demux = strdup( "m4a" );
540-
}
541-
else if( !strcasecmp( p_sys->psz_mime, "audio/mpeg" ) )
542-
{
543-
free( p_access->psz_demux );
544-
p_access->psz_demux = strdup( "mp3" );
545-
}
546-
547-
msg_Info( p_access, "Raw-audio server found, %s demuxer selected",
548-
p_access->psz_demux );
549-
550-
#if 0 /* Doesn't work really well because of the pre-buffering in
551-
* shoutcast servers (the buffer content will be sent as fast as
552-
* possible). */
553-
p_sys->b_pace_control = false;
554-
#endif
555-
}
556-
else if( !p_sys->psz_mime )
557-
{
558-
free( p_access->psz_demux );
559-
/* Shoutcast */
560-
p_access->psz_demux = strdup( "mp3" );
561-
}
562-
/* else probably Ogg Vorbis */
563-
}
564-
else if( !strcasecmp( psz_access, "unsv" ) &&
565-
p_sys->psz_mime &&
566-
!strcasecmp( p_sys->psz_mime, "misc/ultravox" ) )
567-
{
568-
free( p_access->psz_demux );
569-
/* Grrrr! detect ultravox server and force NSV demuxer */
570-
p_access->psz_demux = strdup( "nsv" );
571-
}
572-
else if( !strcmp( psz_access, "itpc" ) )
573-
{
574-
free( p_access->psz_demux );
575-
p_access->psz_demux = strdup( "podcast" );
576-
}
577-
578525
if( p_sys->b_reconnect ) msg_Dbg( p_access, "auto re-connect enabled" );
579526

580527
return VLC_SUCCESS;

modules/access/vcd/vcd.c

-3
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ static int Open( vlc_object_t *p_this )
203203
p_access->info.i_pos = (uint64_t)( p_sys->i_sector - p_sys->p_sectors[1+i_title] ) *
204204
VCD_DATA_SIZE;
205205

206-
free( p_access->psz_demux );
207-
p_access->psz_demux = strdup( "ps" );
208-
209206
return VLC_SUCCESS;
210207

211208
error:

modules/access/vcdx/access.c

-3
Original file line numberDiff line numberDiff line change
@@ -936,9 +936,6 @@ VCDOpen ( vlc_object_t *p_this )
936936

937937
vcdplayer_play( p_access, itemid );
938938

939-
free( p_access->psz_demux );
940-
p_access->psz_demux = strdup( "ps" );
941-
942939
#ifdef FIXED
943940
if( play_single_item )
944941
VCDFixupPlayList(p_access,p_vcd,psz_source,&itemid,play_single_item);

modules/access/vdr.c

-2
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ static int Open( vlc_object_t *p_this )
201201
return VLC_EGENERIC;
202202
}
203203

204-
free( p_access->psz_demux );
205-
p_access->psz_demux = strdup( p_sys->b_ts_format ? "ts" : "ps" );
206204
return VLC_SUCCESS;
207205
}
208206

src/input/access.c

+3-8
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ char *get_path(const char *location)
5454
* access_New:
5555
*****************************************************************************/
5656
access_t *access_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
57-
const char *psz_access, const char *psz_demux,
58-
const char *psz_location )
57+
const char *psz_access, const char *psz_location )
5958
{
6059
access_t *p_access = vlc_custom_create( p_obj, sizeof (*p_access),
6160
"access" );
@@ -70,9 +69,7 @@ access_t *access_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
7069
p_access->psz_access = strdup( psz_access );
7170
p_access->psz_location = strdup( psz_location );
7271
p_access->psz_filepath = get_path( psz_location );
73-
p_access->psz_demux = strdup( psz_demux );
74-
if( p_access->psz_access == NULL || p_access->psz_location == NULL
75-
|| p_access->psz_demux == NULL )
72+
if( p_access->psz_access == NULL || p_access->psz_location == NULL )
7673
goto error;
7774

7875
msg_Dbg( p_obj, "creating access '%s' location='%s', path='%s'",
@@ -100,7 +97,6 @@ access_t *access_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
10097
free( p_access->psz_access );
10198
free( p_access->psz_location );
10299
free( p_access->psz_filepath );
103-
free( p_access->psz_demux );
104100
vlc_object_release( p_access );
105101
return NULL;
106102
}
@@ -115,7 +111,7 @@ access_t *vlc_access_NewMRL(vlc_object_t *parent, const char *mrl)
115111
input_SplitMRL(&access, &demux, &location, &anchor, buf);
116112

117113
/* Both demux and anchor are ignored, since they are of no use here. */
118-
access_t *obj = access_New(parent, NULL, access, "", location);
114+
access_t *obj = access_New(parent, NULL, access, location);
119115

120116
free(buf);
121117
return obj;
@@ -128,7 +124,6 @@ void vlc_access_Delete(access_t *access)
128124
free(access->psz_access);
129125
free(access->psz_location);
130126
free(access->psz_filepath);
131-
free(access->psz_demux);
132127
vlc_object_release(access);
133128
}
134129

src/input/access.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
#include <vlc_access.h>
3030

3131
access_t *access_New( vlc_object_t *p_obj, input_thread_t *p_input,
32-
const char *psz_access, const char *psz_demux,
33-
const char *psz_path );
34-
#define access_New( a, b, c, d, e ) access_New(VLC_OBJECT(a), b, c, d, e )
32+
const char *psz_access, const char *psz_path );
33+
#define access_New( a, b, c, d ) access_New(VLC_OBJECT(a), b, c, d )
3534

3635
char *get_path(const char *location);
3736

src/input/input.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,7 @@ static int InputSourceInit( input_thread_t *p_input,
22862286

22872287
/* */
22882288
access_t *p_access = access_New( p_input, p_input,
2289-
psz_access, psz_demux, psz_path );
2289+
psz_access, psz_path );
22902290
if( p_access == NULL )
22912291
{
22922292
msg_Err( p_input, "open of `%s' failed", psz_mrl );
@@ -2298,8 +2298,7 @@ static int InputSourceInit( input_thread_t *p_input,
22982298
}
22992299

23002300
/* Access-forced demuxer (PARENTAL ADVISORY: EXPLICIT HACK) */
2301-
if( !psz_demux[0] || !strcasecmp( psz_demux, "any" ) )
2302-
psz_demux = p_access->psz_demux;
2301+
#warning FIXME: parse content type
23032302

23042303
/* Create the stream_t */
23052304
stream_t *p_stream = stream_AccessNew( p_access );

0 commit comments

Comments
 (0)