mirror of https://code.videolan.org/videolan/vlc
rd: collapse vlc_rd_start() into vlc_rd_new()
Missing bits of previous changeset. Fixes Libvlc.
This commit is contained in:
parent
a7c83d6d39
commit
5e407d5f93
|
@ -146,15 +146,6 @@ vlc_rd_new(vlc_object_t *p_obj, const char *psz_name,
|
|||
|
||||
VLC_API void vlc_rd_release(vlc_renderer_discovery_t *p_rd);
|
||||
|
||||
/**
|
||||
* Start the renderer discovery module
|
||||
*
|
||||
* Once started, the module can send new vlc_renderer_item_t via the
|
||||
* vlc_RendererDiscoveryItemAdded event.
|
||||
*/
|
||||
VLC_API int
|
||||
vlc_rd_start(vlc_renderer_discovery_t *p_rd);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @defgroup vlc_renderer_discovery_module VLC renderer module
|
||||
|
|
|
@ -89,19 +89,11 @@ static void renderer_event_item_removed(vlc_renderer_discovery_t *rd,
|
|||
// Create renderer object
|
||||
p_rd = vlc_rd_new(VLC_OBJECT(p_intf), _name.UTF8String, &owner);
|
||||
|
||||
if (p_rd) {
|
||||
} else {
|
||||
if (!p_rd) {
|
||||
msg_Err(p_intf, "Could not create '%s' renderer discovery service", _name.UTF8String);
|
||||
return false;
|
||||
}
|
||||
|
||||
int ret = vlc_rd_start(p_rd);
|
||||
if (ret != VLC_SUCCESS) {
|
||||
msg_Err(p_intf, "Could not start '%s' renderer discovery", _name.UTF8String);
|
||||
vlc_rd_release(p_rd);
|
||||
p_rd = NULL;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -329,15 +329,7 @@ void ActionsManager::ScanRendererAction(bool checked)
|
|||
msg_Dbg( p_intf, "starting renderer discovery service %s", *ppsz_longname );
|
||||
vlc_renderer_discovery_t* p_rd = vlc_rd_new( VLC_OBJECT(p_intf), *ppsz_name, &owner );
|
||||
if( p_rd != NULL )
|
||||
{
|
||||
if ( vlc_rd_start( p_rd ) == VLC_SUCCESS )
|
||||
m_rds.push_back( p_rd );
|
||||
else
|
||||
{
|
||||
msg_Err( p_intf, "Could not start renderer discovery service %s", *ppsz_name );
|
||||
vlc_rd_release( p_rd );
|
||||
}
|
||||
}
|
||||
m_rds.push_back( p_rd );
|
||||
free( *ppsz_name );
|
||||
free( *ppsz_longname );
|
||||
}
|
||||
|
|
|
@ -762,5 +762,4 @@ vlc_renderer_item_flags
|
|||
vlc_rd_get_names
|
||||
vlc_rd_new
|
||||
vlc_rd_release
|
||||
vlc_rd_start
|
||||
vlc_rd_probe_add
|
||||
|
|
|
@ -234,9 +234,7 @@ vlc_rd_get_names(vlc_object_t *p_obj, char ***pppsz_names,
|
|||
|
||||
void vlc_rd_release(vlc_renderer_discovery_t *p_rd)
|
||||
{
|
||||
if (p_rd->p_module != NULL)
|
||||
module_unneed(p_rd, p_rd->p_module);
|
||||
|
||||
module_unneed(p_rd, p_rd->p_module);
|
||||
config_ChainDestroy(p_rd->p_cfg);
|
||||
free(p_rd->psz_name);
|
||||
vlc_object_release(p_rd);
|
||||
|
@ -254,23 +252,14 @@ vlc_rd_new(vlc_object_t *p_obj, const char *psz_name,
|
|||
free(config_ChainCreate(&p_rd->psz_name, &p_rd->p_cfg, psz_name));
|
||||
|
||||
p_rd->owner = *owner;
|
||||
|
||||
p_rd->p_module = NULL;
|
||||
return p_rd;
|
||||
}
|
||||
|
||||
int
|
||||
vlc_rd_start(vlc_renderer_discovery_t *p_rd)
|
||||
{
|
||||
assert(!p_rd->p_module);
|
||||
|
||||
p_rd->p_module = module_need(p_rd, "renderer_discovery",
|
||||
p_rd->psz_name, true);
|
||||
if (p_rd->p_module == NULL)
|
||||
{
|
||||
msg_Err(p_rd, "no suitable renderer discovery module");
|
||||
return VLC_EGENERIC;
|
||||
vlc_object_release(p_rd);
|
||||
p_rd = NULL;
|
||||
}
|
||||
|
||||
return VLC_SUCCESS;
|
||||
return p_rd;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue