Commit c34114a5 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

access: remove access_GetParentInput()

If there is a parent input, it cannot go away. There was no point in
reference counting.
parent 5ce6b6a8
...@@ -252,12 +252,6 @@ static inline void access_InitFields( access_t *p_a ) ...@@ -252,12 +252,6 @@ static inline void access_InitFields( access_t *p_a )
p_a->info.b_eof = false; p_a->info.b_eof = false;
} }
/**
* This function will return the parent input of this access.
* It is retained. It can return NULL.
*/
VLC_API input_thread_t * access_GetParentInput( access_t *p_access ) VLC_USED;
/** /**
* Default pf_control callback for directory accesses. * Default pf_control callback for directory accesses.
*/ */
......
...@@ -68,7 +68,7 @@ static int Open(vlc_object_t *object) ...@@ -68,7 +68,7 @@ static int Open(vlc_object_t *object)
access_t *access = (access_t *)object; access_t *access = (access_t *)object;
access_sys_t *sys; access_sys_t *sys;
input_thread_t *input = access_GetParentInput(access); input_thread_t *input = access->p_input;
if (!input) if (!input)
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -76,8 +76,6 @@ static int Open(vlc_object_t *object) ...@@ -76,8 +76,6 @@ static int Open(vlc_object_t *object)
if (input_Control(input, INPUT_GET_ATTACHMENT, &a, access->psz_location)) if (input_Control(input, INPUT_GET_ATTACHMENT, &a, access->psz_location))
a = NULL; a = NULL;
vlc_object_release(input);
if (!a) { if (!a) {
msg_Err(access, "Failed to find the attachment '%s'", msg_Err(access, "Failed to find the attachment '%s'",
access->psz_location); access->psz_location);
......
...@@ -174,7 +174,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -174,7 +174,7 @@ static int Open( vlc_object_t *p_this )
if( p_sys->i_track < 0 ) if( p_sys->i_track < 0 )
{ {
/* We only do separate items if the whole disc is requested */ /* We only do separate items if the whole disc is requested */
input_thread_t *p_input = access_GetParentInput( p_access ); input_thread_t *p_input = p_access->p_input;
int i_ret = -1; int i_ret = -1;
if( p_input ) if( p_input )
...@@ -182,8 +182,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -182,8 +182,6 @@ static int Open( vlc_object_t *p_this )
input_item_t *p_current = input_GetItem( p_input ); input_item_t *p_current = input_GetItem( p_input );
if( p_current ) if( p_current )
i_ret = GetTracks( p_access, p_current ); i_ret = GetTracks( p_access, p_current );
vlc_object_release( p_input );
} }
if( i_ret < 0 ) if( i_ret < 0 )
goto error; goto error;
......
...@@ -858,13 +858,12 @@ static int ReadICYMeta( access_t *p_access ) ...@@ -858,13 +858,12 @@ static int ReadICYMeta( access_t *p_access )
free( psz_tmp ); free( psz_tmp );
msg_Dbg( p_access, "New Icy-Title=%s", p_sys->psz_icy_title ); msg_Dbg( p_access, "New Icy-Title=%s", p_sys->psz_icy_title );
input_thread_t *p_input = access_GetParentInput( p_access ); input_thread_t *p_input = p_access->p_input;
if( p_input ) if( p_input )
{ {
input_item_t *p_input_item = input_GetItem( p_access->p_input ); input_item_t *p_input_item = input_GetItem( p_access->p_input );
if( p_input_item ) if( p_input_item )
input_item_SetMeta( p_input_item, vlc_meta_NowPlaying, p_sys->psz_icy_title ); input_item_SetMeta( p_input_item, vlc_meta_NowPlaying, p_sys->psz_icy_title );
vlc_object_release( p_input );
} }
} }
} }
...@@ -1452,13 +1451,12 @@ static int Request( access_t *p_access, uint64_t i_tell ) ...@@ -1452,13 +1451,12 @@ static int Request( access_t *p_access, uint64_t i_tell )
else else
resolve_xml_special_chars( p_sys->psz_icy_name ); resolve_xml_special_chars( p_sys->psz_icy_name );
msg_Dbg( p_access, "Icy-Name: %s", p_sys->psz_icy_name ); msg_Dbg( p_access, "Icy-Name: %s", p_sys->psz_icy_name );
input_thread_t *p_input = access_GetParentInput( p_access ); input_thread_t *p_input = p_access->p_input;
if ( p_input ) if ( p_input )
{ {
input_item_t *p_input_item = input_GetItem( p_access->p_input ); input_item_t *p_input_item = input_GetItem( p_access->p_input );
if ( p_input_item ) if ( p_input_item )
input_item_SetMeta( p_input_item, vlc_meta_Title, p_sys->psz_icy_name ); input_item_SetMeta( p_input_item, vlc_meta_Title, p_sys->psz_icy_name );
vlc_object_release( p_input );
} }
p_sys->b_icecast = true; /* be on the safeside. set it here as well. */ p_sys->b_icecast = true; /* be on the safeside. set it here as well. */
...@@ -1475,13 +1473,12 @@ static int Request( access_t *p_access, uint64_t i_tell ) ...@@ -1475,13 +1473,12 @@ static int Request( access_t *p_access, uint64_t i_tell )
else else
resolve_xml_special_chars( p_sys->psz_icy_genre ); resolve_xml_special_chars( p_sys->psz_icy_genre );
msg_Dbg( p_access, "Icy-Genre: %s", p_sys->psz_icy_genre ); msg_Dbg( p_access, "Icy-Genre: %s", p_sys->psz_icy_genre );
input_thread_t *p_input = access_GetParentInput( p_access ); input_thread_t *p_input = p_access->p_input;
if( p_input ) if( p_input )
{ {
input_item_t *p_input_item = input_GetItem( p_access->p_input ); input_item_t *p_input_item = input_GetItem( p_access->p_input );
if( p_input_item ) if( p_input_item )
input_item_SetMeta( p_input_item, vlc_meta_Genre, p_sys->psz_icy_genre ); input_item_SetMeta( p_input_item, vlc_meta_Genre, p_sys->psz_icy_genre );
vlc_object_release( p_input );
} }
} }
else if( !strncasecmp( psz, "Icy-Notice", 10 ) ) else if( !strncasecmp( psz, "Icy-Notice", 10 ) )
......
...@@ -154,7 +154,7 @@ int MMSHOpen( access_t *p_access ) ...@@ -154,7 +154,7 @@ int MMSHOpen( access_t *p_access )
{ {
msg_Dbg( p_access, "redirection to %s", psz_location ); msg_Dbg( p_access, "redirection to %s", psz_location );
input_thread_t * p_input = access_GetParentInput( p_access ); input_thread_t * p_input = p_access->p_input;
input_item_t * p_new_loc; input_item_t * p_new_loc;
if( !p_input ) if( !p_input )
...@@ -168,7 +168,6 @@ int MMSHOpen( access_t *p_access ) ...@@ -168,7 +168,6 @@ int MMSHOpen( access_t *p_access )
input_item_PostSubItem( p_item, p_new_loc ); input_item_PostSubItem( p_item, p_new_loc );
vlc_gc_decref( p_new_loc ); vlc_gc_decref( p_new_loc );
vlc_object_release( p_input );
free( psz_location ); free( psz_location );
......
...@@ -882,7 +882,7 @@ VCDOpen ( vlc_object_t *p_this ) ...@@ -882,7 +882,7 @@ VCDOpen ( vlc_object_t *p_this )
"-track-length" ); "-track-length" );
p_vcdplayer->in_still = false; p_vcdplayer->in_still = false;
p_vcdplayer->play_item.type = VCDINFO_ITEM_TYPE_NOTFOUND; p_vcdplayer->play_item.type = VCDINFO_ITEM_TYPE_NOTFOUND;
p_vcdplayer->p_input = access_GetParentInput( p_access ); p_vcdplayer->p_input = p_access->p_input;
// p_vcdplayer->p_meta = vlc_meta_New(); // p_vcdplayer->p_meta = vlc_meta_New();
p_vcdplayer->p_segments = NULL; p_vcdplayer->p_segments = NULL;
p_vcdplayer->p_entries = NULL; p_vcdplayer->p_entries = NULL;
...@@ -950,7 +950,6 @@ VCDOpen ( vlc_object_t *p_this ) ...@@ -950,7 +950,6 @@ VCDOpen ( vlc_object_t *p_this )
return VLC_SUCCESS; return VLC_SUCCESS;
err_exit: err_exit:
if( p_vcdplayer->p_input ) vlc_object_release( p_vcdplayer->p_input );
free( psz_source ); free( psz_source );
free( p_vcdplayer->psz_source ); free( p_vcdplayer->psz_source );
free( p_vcdplayer ); free( p_vcdplayer );
...@@ -977,8 +976,6 @@ VCDClose ( vlc_object_t *p_this ) ...@@ -977,8 +976,6 @@ VCDClose ( vlc_object_t *p_this )
vcdinfo_close( p_vcdplayer->vcd ); vcdinfo_close( p_vcdplayer->vcd );
if( p_vcdplayer->p_input ) vlc_object_release( p_vcdplayer->p_input );
FREENULL( p_vcdplayer->p_entries ); FREENULL( p_vcdplayer->p_entries );
FREENULL( p_vcdplayer->p_segments ); FREENULL( p_vcdplayer->p_segments );
FREENULL( p_vcdplayer->psz_source ); FREENULL( p_vcdplayer->psz_source );
......
...@@ -132,14 +132,6 @@ void vlc_access_Delete(access_t *access) ...@@ -132,14 +132,6 @@ void vlc_access_Delete(access_t *access)
vlc_object_release(access); vlc_object_release(access);
} }
/*****************************************************************************
* access_GetParentInput:
*****************************************************************************/
input_thread_t * access_GetParentInput( access_t *p_access )
{
return p_access->p_input ? vlc_object_hold((vlc_object_t *)p_access->p_input) : NULL;
}
/***************************************************************************** /*****************************************************************************
* access_vaDirectoryControlHelper: * access_vaDirectoryControlHelper:
*****************************************************************************/ *****************************************************************************/
......
access_GetParentInput
access_vaDirectoryControlHelper access_vaDirectoryControlHelper
vlc_access_NewMRL vlc_access_NewMRL
vlc_access_Delete vlc_access_Delete
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment