[vlc-devel] [PATCH 3/5] podcast: use its own input thread helper
Thomas Guillem
thomas at gllm.fr
Tue Jul 10 15:43:07 CEST 2018
This module need a heavy fixing: lot of missing check of returns functions.
---
modules/services_discovery/podcast.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules/services_discovery/podcast.c b/modules/services_discovery/podcast.c
index 327b58ca3a..690a324718 100644
--- a/modules/services_discovery/podcast.c
+++ b/modules/services_discovery/podcast.c
@@ -210,6 +210,18 @@ static void Close( vlc_object_t *p_this )
/*****************************************************************************
* Run: main thread
*****************************************************************************/
+static input_thread_t *InputCreateAndStart( services_discovery_t *sd,
+ input_item_t *item )
+{
+ input_thread_t *input = input_Create( sd, item, NULL, NULL, NULL );
+ if( input != NULL && input_Start( input ) )
+ {
+ vlc_object_release( input );
+ input = NULL;
+ }
+ return input;
+}
+
noreturn static void *Run( void *data )
{
services_discovery_t *p_sd = data;
@@ -329,7 +341,7 @@ static void ParseUrls( services_discovery_t *p_sd, char *psz_urls )
services_discovery_AddItem( p_sd, p_input );
TAB_APPEND( p_sys->i_input, p_sys->pp_input,
- input_CreateAndStart( p_sd, p_input, NULL ) );
+ InputCreateAndStart( p_sd, p_input ) );
}
else
{
@@ -404,7 +416,7 @@ static void ParseRequest( services_discovery_t *p_sd )
services_discovery_AddItem( p_sd, p_input );
TAB_APPEND( p_sys->i_input, p_sys->pp_input,
- input_CreateAndStart( p_sd, p_input, NULL ) );
+ InputCreateAndStart( p_sd, p_input ) );
SaveUrls( p_sd );
}
}
--
2.18.0
More information about the vlc-devel
mailing list