[MPlayer-dev-eng] [PATCH] Following ASF redirections and detecting ASX playlist

bl4 bl4 at playker.info
Sun Apr 20 13:07:34 CEST 2008


Compn wrote:
> On Sun, 20 Apr 2008 00:30:47 +0200, bl4 wrote:
>   
>> Hi,
>>
>> The second problem is ASX playlist detection. If mplayer is started
>> with -playlist option, everything is fine, but I think it should be
>> the player, not the user, that checks if the URL is a playlist.
>> Especially if one uses mplayer plugin in a web browser and doesn't
>> have chance to modify mplayer command line.
>>     
>
> mplayer used to detect playlists by default, but this was disabled
> because the playlist code is buggy and or insecure.
>   

I don't understand. mplayer does detect playlists, but only by checking 
content-type. Here's a fragment of a structure in mplayer code:

const mime_struct_t mime_type_table[] = {
// ...
{ "audio/x-ms-wma", DEMUXER_TYPE_ASF },
{ "video/x-ms-asf", DEMUXER_TYPE_ASF },
{ "video/x-ms-wmx", DEMUXER_TYPE_PLAYLIST },
{ "video/x-ms-wvx", DEMUXER_TYPE_PLAYLIST },
// ...
}

It assumes that server will always respond with different content-type 
for stream and for playlist. When http response is received, this 
structure is searched for the content-type. Whether url is treated as 
stream or as playlist depends on the value that is associated with the 
content-type.

If server sends an asx playlist with, for example, video/x-ms-wmx 
content-type, mplayer recognizes it as playlist and -playlist option is 
not necessary. My point is that if server sends the same playlist with 
video/x-ms-asf content-type, mplayer doesn't recognize it as playlist. 
My patch fixes this by checking what is in the beginning of the content.

> mplayer is missing mms playlist support, xine has it. more info:
> http://bugzilla.mplayerhq.hu/show_bug.cgi?id=424
>   

That's something different and not what I mean. In my case, playlist is 
delivered through http. mms urls are generated dynamically and hidden 
behind some http redirections. Each mms url is played well if passed to 
mplayer seperately.

Unfortunately, mplayer can't figure out these redirections. If server 
responds with 302 code and destination url in the Location header, 
mplayer follows it correctly. In my case, server responds with 200 and 
the url is in the content. mplayer doesn't realize that it's a 
redirection. My patch fixes this, as I said in my previous message.

I didn't have luck with mms in xine. I've tried some other players too 
and only mplayer can play mms without problems. It was easy to write a 
Perl script that solved these issues with playlists and redirections. It 
wasn't difficult to fix mplayer source code too.

bl4



More information about the MPlayer-dev-eng mailing list