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

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 )
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.
*/
......
......@@ -68,7 +68,7 @@ static int Open(vlc_object_t *object)
access_t *access = (access_t *)object;
access_sys_t *sys;
input_thread_t *input = access_GetParentInput(access);
input_thread_t *input = access->p_input;
if (!input)
return VLC_EGENERIC;
......@@ -76,8 +76,6 @@ static int Open(vlc_object_t *object)
if (input_Control(input, INPUT_GET_ATTACHMENT, &a, access->psz_location))
a = NULL;
vlc_object_release(input);
if (!a) {
msg_Err(access, "Failed to find the attachment '%s'",
access->psz_location);
......
......@@ -174,7 +174,7 @@ static int Open( vlc_object_t *p_this )
if( p_sys->i_track < 0 )
{
/* 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;
if( p_input )
......@@ -182,8 +182,6 @@ static int Open( vlc_object_t *p_this )
input_item_t *p_current = input_GetItem( p_input );
if( p_current )
i_ret = GetTracks( p_access, p_current );
vlc_object_release( p_input );
}
if( i_ret < 0 )
goto error;
......
......@@ -858,13 +858,12 @@ static int ReadICYMeta( access_t *p_access )
free( psz_tmp );
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 )
{
input_item_t *p_input_item = input_GetItem( p_access->p_input );
if( p_input_item )
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 )
else
resolve_xml_special_chars( 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 )
{
input_item_t *p_input_item = input_GetItem( p_access->p_input );
if ( p_input_item )
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. */
......@@ -1475,13 +1473,12 @@ static int Request( access_t *p_access, uint64_t i_tell )
else
resolve_xml_special_chars( 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 )
{
input_item_t *p_input_item = input_GetItem( p_access->p_input );
if( p_input_item )
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 ) )
......
......@@ -154,7 +154,7 @@ int MMSHOpen( access_t *p_access )
{
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;
if( !p_input )
......@@ -168,7 +168,6 @@ int MMSHOpen( access_t *p_access )
input_item_PostSubItem( p_item, p_new_loc );
vlc_gc_decref( p_new_loc );
vlc_object_release( p_input );
free( psz_location );
......
......@@ -882,7 +882,7 @@ VCDOpen ( vlc_object_t *p_this )
"-track-length" );
p_vcdplayer->in_still = false;
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_segments = NULL;
p_vcdplayer->p_entries = NULL;
......@@ -950,7 +950,6 @@ VCDOpen ( vlc_object_t *p_this )
return VLC_SUCCESS;
err_exit:
if( p_vcdplayer->p_input ) vlc_object_release( p_vcdplayer->p_input );
free( psz_source );
free( p_vcdplayer->psz_source );
free( p_vcdplayer );
......@@ -977,8 +976,6 @@ VCDClose ( vlc_object_t *p_this )
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_segments );
FREENULL( p_vcdplayer->psz_source );
......
......@@ -132,14 +132,6 @@ void vlc_access_Delete(access_t *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_GetParentInput
access_vaDirectoryControlHelper
vlc_access_NewMRL
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