[vlc-commits] demux: develop demux_Delete() into destroy callback
Rémi Denis-Courmont
git at videolan.org
Fri Mar 30 10:31:29 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Mar 29 19:04:20 2018 +0300| [a209aeaabac0cedf0ca1b77e7447165e22986a4c] | committer: Rémi Denis-Courmont
demux: develop demux_Delete() into destroy callback
(to match vlc_stream_Delete())
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a209aeaabac0cedf0ca1b77e7447165e22986a4c
---
src/input/demux.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/input/demux.c b/src/input/demux.c
index a8e049bdea..1b32703d1b 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -154,18 +154,29 @@ typedef struct demux_priv_t
static void demux_DestroyDemux(demux_t *demux)
{
+ module_unneed(demux, demux->p_module);
+ free(demux->psz_filepath);
+ free(demux->psz_name);
+
assert(demux->s != NULL);
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);
- (void) demux;
}
static void demux_DestroyDemuxFilter(demux_t *demux)
{
+ module_unneed(demux, demux->p_module);
+ free(demux->psz_filepath);
+ free(demux->psz_name);
+
assert(demux->p_next != NULL);
demux_Delete(demux->p_next);
}
@@ -285,12 +296,8 @@ void demux_Delete( demux_t *p_demux )
{
demux_priv_t *priv = (demux_priv_t *)p_demux;
- module_unneed( p_demux, p_demux->p_module );
-
priv->destroy(p_demux);
- free( p_demux->psz_filepath );
free( p_demux->psz_url );
- free( p_demux->psz_name );
vlc_object_release( p_demux );
}
More information about the vlc-commits
mailing list