mirror of https://code.videolan.org/videolan/vlc
sout: dlna: switch to the close callback
This commit is contained in:
parent
8f12f1a35e
commit
451a8ce5ba
|
@ -170,7 +170,7 @@ vlc_module_begin()
|
|||
set_capability("sout output", 0)
|
||||
add_shortcut("dlna")
|
||||
set_subcategory(SUBCAT_SOUT_STREAM)
|
||||
set_callbacks(DLNA::OpenSout, DLNA::CloseSout)
|
||||
set_callback(DLNA::OpenSout)
|
||||
|
||||
add_string(SOUT_CFG_PREFIX "ip", NULL, IP_ADDR_TEXT, IP_ADDR_LONGTEXT)
|
||||
add_integer(SOUT_CFG_PREFIX "port", 0, PORT_TEXT, PORT_LONGTEXT)
|
||||
|
|
|
@ -858,12 +858,22 @@ static void Del(sout_stream_t *p_stream, void *_id)
|
|||
}
|
||||
}
|
||||
|
||||
static void CloseSout( sout_stream_t *p_stream )
|
||||
{
|
||||
sout_stream_sys_t *p_sys = static_cast<sout_stream_sys_t *>( p_stream->p_sys );
|
||||
|
||||
p_sys->renderer->ConnectionComplete();
|
||||
p_sys->p_upnp->release();
|
||||
delete p_sys;
|
||||
}
|
||||
|
||||
static const struct sout_stream_operations ops = [] {
|
||||
struct sout_stream_operations ops {};
|
||||
ops.add = Add;
|
||||
ops.del = Del;
|
||||
ops.send = Send;
|
||||
ops.flush = Flush;
|
||||
ops.close = CloseSout;
|
||||
return ops;
|
||||
}();
|
||||
|
||||
|
@ -922,14 +932,4 @@ error:
|
|||
return VLC_EGENERIC;
|
||||
}
|
||||
|
||||
void CloseSout( vlc_object_t *p_this)
|
||||
{
|
||||
sout_stream_t *p_stream = reinterpret_cast<sout_stream_t*>( p_this );
|
||||
sout_stream_sys_t *p_sys = static_cast<sout_stream_sys_t *>( p_stream->p_sys );
|
||||
|
||||
p_sys->renderer->ConnectionComplete();
|
||||
p_sys->p_upnp->release();
|
||||
delete p_sys;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -35,9 +35,8 @@
|
|||
namespace DLNA
|
||||
{
|
||||
|
||||
/* module callbacks */
|
||||
/* module callback */
|
||||
int OpenSout(vlc_object_t *);
|
||||
void CloseSout(vlc_object_t *);
|
||||
|
||||
}
|
||||
#endif /* DLNA_COMMON_H */
|
||||
|
|
Loading…
Reference in New Issue