sout: trace: switch to the close callback

This commit is contained in:
Alaric Senat 2023-11-10 16:51:40 +01:00 committed by Steve Lhomme
parent e45a399833
commit 0a6ecf1605
1 changed files with 7 additions and 7 deletions

View File

@ -114,6 +114,11 @@ static void Flush(sout_stream_t *stream, void *id)
sout_StreamFlush(stream->p_next, sys_id->next_id);
}
static void Close(sout_stream_t *stream)
{
free(stream->p_sys);
}
#define SOUT_CFG_PREFIX "sout-trace-"
static int Open(vlc_object_t *this)
@ -135,18 +140,13 @@ static int Open(vlc_object_t *this)
.set_pcr = SetPCR,
.control = Control,
.flush = Flush,
.close = Close,
};
stream->ops = &ops;
return VLC_SUCCESS;
}
static void Close(vlc_object_t *this)
{
sout_stream_t *stream = (sout_stream_t *)this;
free(stream->p_sys);
}
#define HELP_TEXT \
N_("This filter module traces all frames and timestamps passing through " \
"it using the VLC tracer." \
@ -168,7 +168,7 @@ vlc_module_begin()
set_capability("sout filter", 0)
set_help(HELP_TEXT)
add_shortcut("trace")
set_callbacks(Open, Close)
set_callback(Open)
add_string(SOUT_CFG_PREFIX "name", NULL, NAME_TEXT, NAME_LONGTEXT)
vlc_module_end()