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

stream_UrlNew: avoid harmful vlc_object_find()

Four access plugins need access to the input at the moment. In all
cases, it would misbehave if the input (item) of the main access was

attachment: failing seems like the correct thing. I don't see a use for
attachment from stream_UrlNew().

CDDA uses the input item to append child nodes for individual tracks.
This is wrong in case of stream_UrlNew(), as the input items would be
wrongly appended to the main access item. Like directory, FTP, etc,
CCDA should probably return a playlist in this particular case.

MMSH uses the input item for redirection. This would not work properly
for stream_UrlNew(): it would rewrite the main access URL instead of
the child stream URL. This failing seems actually safer. Handling the
redirection within the MMS plugin would probably be better.

VCDX uses the input item to fill disc-wide meta data from the GET_TITLE
control request. It should use GET_META instead. In any case, it should
not pollute the meta data of the main access.

Bugs have been filed for the last 3 cases. Fortunately, I doubt any of
these access plugins was ever used through stream_UrlNew().
parent c67b5ea6
......@@ -260,16 +260,8 @@ stream_t *stream_UrlNew( vlc_object_t *p_parent, const char *psz_url )
strcpy( psz_dup, psz_url );
input_SplitMRL( &psz_access, &psz_demux, &psz_path, psz_dup );
/* Get a weak link to the parent input */
/* FIXME: This should probably be removed in favor of a NULL input. */
input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_parent, VLC_OBJECT_INPUT, FIND_PARENT );
/* Now try a real access */
p_access = access_New( p_parent, p_input, psz_access, psz_demux, psz_path );
p_access = access_New( p_parent, NULL, psz_access, psz_demux, psz_path );
if( p_access == NULL )
msg_Err( p_parent, "no suitable access module for `%s'", psz_url );
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment