[vlc-devel] [PATCH] find muxer for stream_out standard

Alexander Gall gall at switch.ch
Fri Aug 10 16:31:09 CEST 2007


modules/stream_out/standard.c:Open() selects the muxer "by extension"
whenever there is a dot in the URL:

    /* ext -> muxer name */
    if( psz_url && strrchr( psz_url, '.' ) )
    
This seems wrong in several respects.  First of all, it is possible
that the muxer has already been selected at this point.  I'm not sure
whether the extension should really override it or only be used as a
fallback (that would be my guess).

Then, the logic with the dot should only be applied to filenames, but
not to domain names and IPv4 addresses.  This must be reflected in the
code somehow.

I stumbled over this when I used an --sout option that contained a mux
as well as a dst specifying an IP address, which caused vlc to execute
the "ext -> muxer name" code and crash at the line

        msg_Dbg( p_this, "extension -> mux=%s", psz_mux_byext );

because it couldn't match the "extension" (i.e. the last octet of the
IP address and the port number) to any of the values of the exttomux
array (this is actually another bug that should be fixed).

I fixed this by restricting the extension logic to the case when
psz_mux is not yet set, but I'm not sure whether this is a complete
fix (what if the muxer is not known an the URL is a network address?
Is this illegal?).

The patch is against the svn trunk.

-- 
Alex

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: standard.c.diff
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070810/f1dcb4d4/attachment.ksh>
-------------- next part --------------
_______________________________________________
vlc-devel mailing list
vlc-devel at videolan.org
http://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list