[vlc-commits] demux: drop support for access_demux
Rémi Denis-Courmont
git at videolan.org
Sat Mar 31 17:02:28 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 24 12:18:38 2018 +0200| [9a248f55603c7eb2c69ae0e505e271abb90fa137] | committer: Rémi Denis-Courmont
demux: drop support for access_demux
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9a248f55603c7eb2c69ae0e505e271abb90fa137
---
src/input/demux.c | 52 ++++++++++++++---------------------------------
src/input/demux.h | 1 -
src/input/demux_chained.c | 4 ++--
src/input/input.c | 13 ------------
4 files changed, 17 insertions(+), 53 deletions(-)
diff --git a/src/input/demux.c b/src/input/demux.c
index c2870767a8..82ab8e824a 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -156,15 +156,6 @@ static void demux_DestroyDemux(demux_t *demux)
vlc_stream_Delete(demux->s);
}
-static void demux_DestroyAccessDemux(demux_t *demux)
-{
- module_unneed(demux, demux->p_module);
- free(demux->psz_filepath);
- free(demux->psz_name);
-
- assert(demux->s == NULL);
-}
-
static int demux_Probe(void *func, va_list ap)
{
int (*probe)(vlc_object_t *) = func;
@@ -181,24 +172,19 @@ static int demux_Probe(void *func, va_list ap)
return probe(VLC_OBJECT(demux));
}
-/*****************************************************************************
- * demux_NewAdvanced:
- * if s is NULL then load a access_demux
- *****************************************************************************/
-#undef demux_NewAdvanced
demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
const char *psz_access, const char *psz_demux,
const char *psz_location,
stream_t *s, es_out_t *out, bool b_preparsing )
{
- void (*destroy)(stream_t *) =
- (s != NULL) ? demux_DestroyDemux : demux_DestroyAccessDemux;
- demux_t *p_demux = vlc_stream_CommonNew(p_obj, destroy);
+ demux_t *p_demux = vlc_stream_CommonNew(p_obj, demux_DestroyDemux);
if (unlikely(p_demux == NULL))
return NULL;
- if( s != NULL && (!strcasecmp( psz_demux, "any" ) || !psz_demux[0]) )
+ assert(s != NULL);
+
+ if (!strcasecmp( psz_demux, "any" ) || !psz_demux[0])
{ /* Look up demux by mime-type for hard to detect formats */
char *type = stream_MimeType( s );
if( type != NULL )
@@ -235,29 +221,21 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
p_demux->pf_control = NULL;
p_demux->p_sys = NULL;
- if( s != NULL )
- {
- const char *psz_module = NULL;
+ const char *psz_module = NULL;
- if( !strcmp( p_demux->psz_name, "any" ) && p_demux->psz_filepath )
- {
- char const* psz_ext = strrchr( p_demux->psz_filepath, '.' );
+ if( !strcmp( p_demux->psz_name, "any" ) && p_demux->psz_filepath )
+ {
+ char const* psz_ext = strrchr( p_demux->psz_filepath, '.' );
- if( psz_ext )
- psz_module = DemuxNameFromExtension( psz_ext + 1, b_preparsing );
- }
+ if( psz_ext )
+ psz_module = DemuxNameFromExtension( psz_ext + 1, b_preparsing );
+ }
- if( psz_module == NULL )
- psz_module = p_demux->psz_name;
+ if( psz_module == NULL )
+ psz_module = p_demux->psz_name;
- p_demux->p_module = vlc_module_load(p_demux, "demux", psz_module,
- !strcmp(psz_module, p_demux->psz_name), demux_Probe, p_demux);
- }
- else
- {
- p_demux->p_module =
- module_need( p_demux, "access_demux", psz_access, true );
- }
+ p_demux->p_module = vlc_module_load(p_demux, "demux", psz_module,
+ !strcmp(psz_module, p_demux->psz_name), demux_Probe, p_demux);
if( p_demux->p_module == NULL )
{
diff --git a/src/input/demux.h b/src/input/demux.h
index 2e9f499c93..a972482592 100644
--- a/src/input/demux.h
+++ b/src/input/demux.h
@@ -34,7 +34,6 @@
demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
const char *psz_access, const char *psz_demux,
const char *psz_path, stream_t *s, es_out_t *out, bool );
-#define demux_NewAdvanced( a, b, c, d, e, f, g, h ) demux_NewAdvanced(VLC_OBJECT(a),b,c,d,e,f,g,h)
unsigned demux_TestAndClearFlags( demux_t *, unsigned );
int demux_GetTitle( demux_t * );
diff --git a/src/input/demux_chained.c b/src/input/demux_chained.c
index 65ad7ee9e6..9c9f96bd14 100644
--- a/src/input/demux_chained.c
+++ b/src/input/demux_chained.c
@@ -53,8 +53,8 @@ struct vlc_demux_chained_t
static void *vlc_demux_chained_Thread(void *data)
{
vlc_demux_chained_t *dc = data;
- demux_t *demux = demux_NewAdvanced(dc->fifo, NULL, "", dc->name, "",
- dc->fifo, dc->out, false);
+ demux_t *demux = demux_NewAdvanced(VLC_OBJECT(dc->fifo), NULL, "",
+ dc->name, "", dc->fifo, dc->out, false);
if (demux == NULL)
{
vlc_stream_Delete(dc->fifo);
diff --git a/src/input/input.c b/src/input/input.c
index 47db3efaed..f4d49b809f 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2411,19 +2411,6 @@ static demux_t *InputDemuxNew( input_thread_t *p_input, input_source_t *p_source
vlc_object_t *obj = VLC_OBJECT(p_source);
demux_t *p_demux = NULL;
- /* first, try to create an access demux */
- p_demux = demux_NewAdvanced( obj, p_input, psz_access, psz_access,
- psz_path, NULL, priv->p_es_out,
- priv->b_preparsing );
- if( p_demux )
- {
- MRLSections( psz_anchor,
- &p_source->i_title_start, &p_source->i_title_end,
- &p_source->i_seekpoint_start, &p_source->i_seekpoint_end );
-
- return p_demux;
- }
-
/* not an access-demux: create the underlying access stream */
char *psz_base_mrl;
More information about the vlc-commits
mailing list