[MPlayer-dev-eng] [PATCH] (take 3) Problem in libmpdemux/asf-streaming.c (was Problem in opening URLs)

Alex Eskin alexeskin at yahoo.com
Thu Mar 4 06:42:36 CET 2004


Sorry, I do not mean to bug anyone, but why wasn't this
patch applied? 

It really should not be contoversial. The main effect is
to revert patch 1.42 of asf_streaming.c. That patch is just
wrong. I just did some historical research and found this thread:
http://www1.mplayerhq.hu/pipermail/mplayer-dev-eng/2003-October/021875.html

(In short, Bertrand Baudet, who is listed as maintainer of network
streaming support, was against that patch, but it somehow got applied
anyway). 

Also, is Bertand still the maintainer?  


--- Alex Eskin <alexeskin at yahoo.com> wrote:
> I did not get any comments on this patch, but there were several
> threads, both here and on mplayer-users complaining about the
> bug this is supposed to fix. 
> --------
> 
> I am attaching a revised patch dealing with x-mms-asf URL's
> 
> Description of problem:
> 
> the video/x-mms-asf mime type is ambiguous. It can be
> 
> (1) An asx redirector. This is the most common usage. In fact, most
>    of the windows media on the web today is behind an asx redirector
>    with the video/x-mms-asf mime-type.
> 
> (2) A non-streaming microsoft media (asf) file. 
> 
> (3) An asf stream (live or prerecorded). I have never actually seen
>    one, but I infer from the code that it must exist. 
>    (By the way, if somebody knows a URL of this type, I would be
>      very interested). 
> 
> 
> What does the current code do:
> 
>    It assumes unconditionally type (3). If it gets type (1) or (2)
>    it bails.  This has the effect of breaking most of the windows
> media
>    sites out there. 
> 
>    In fact the current behaviour is probably not intended. The code
>    is basically 
>    if ( content_type == "video/x-mms-asf" ) { 
>          //assume type (3)
>    } else if (content_type == "video/x-mms-asf") {
>           //figure out if it is type (1) or type (2)
>    }
>         
> What does the proposed patch do:
> 
>     It is only a 99% solution. If it gets video/x-mms-url
>     it peeks in the stream to see if there is an asf-streaming
>     header. If yes, it is type (3). If no, then it is type (1)
>     or (2). 
> 
>     It is only 99% because it does not read extra bytes from the
>     socket (it only needs 5 in the buffer). There are other
>     places in the code which do that, and it seems to work well.
>     Still if people want a 100% solution I can recode it. 
> 
> 
> Even if this patch is not it, I hope that some way can be found to 
> solve this issue. 
>      
> 
> Alex Eskin
> 
>  
> 
> __________________________________
> Do you Yahoo!?
> Get better spam protection with Yahoo! Mail.
> http://antispam.yahoo.com/tools> --- libmpdemux/asf_streaming.c
2004-02-11 22:46:25.000000000 -0600
> +++ libmpdemux/asf_streaming.c.orig	2004-02-10 01:26:04.000000000
> -0600
> @@ -417,39 +417,14 @@
>  }
>  
>  int
> -asf_streaming_header_check(HTTP_header_t *http_hdr) {
> -        ASF_stream_chunck_t stream_chunck;
> -	if( http_hdr == NULL ) return -1;
> -        if( http_hdr->body==NULL || 
> -	    http_hdr->body_size<sizeof(ASF_stream_chunck_t) ) {
> -		mp_msg(MSGT_NETWORK,MSGL_V,"streaming_header_check: too_few bytes
> read for proper test\n");
> -
> -		 return -1;
> -	}
> -	memcpy(&stream_chunck,http_hdr->body,sizeof(ASF_stream_chunck_t));
> -	le2me_ASF_stream_chunck_t(&stream_chunck);
> -        if (stream_chunck.type != ASF_STREAMING_HEADER) {
> -		return -2;
> -	}
> -	if ( stream_chunck.size !=stream_chunck.size_confirm ) {
> -		return -2;
> -	}
> -	return 0;
> -
> -}
> -	  
> -
> -
> -int
> -asf_http_streaming_type(char *content_type, char *features,
> HTTP_header_t *http_hdr, int request ) {
> +asf_http_streaming_type(char *content_type, char *features,
> HTTP_header_t *http_hdr ) {
>  	if( content_type==NULL ) return ASF_Unknown_e;
>  	if( 	!strcasecmp(content_type, "application/octet-stream") ||
>  		!strcasecmp(content_type, "application/vnd.ms.wms-hdr.asfv1") ||  
>      // New in Corona, first request
>  		!strcasecmp(content_type, "application/x-mms-framed") ||          
>      // New in Corana, second request
> -		( !strcasecmp(content_type, "video/x-ms-asf") && 
> -		  (request > 1 || asf_streaming_header_check(http_hdr)==0 ))) {
> +		!strcasecmp(content_type, "video/x-ms-asf")) {               
>  
> -	        if( strstr(features, "broadcast") ) {
> +		if( strstr(features, "broadcast") ) {
>  			mp_msg(MSGT_NETWORK,MSGL_V,"=====> ASF Live stream\n");
>  			return ASF_Live_e;
>  		} else {
> @@ -647,7 +622,7 @@
>  		} while( comma_ptr!=NULL );
>  		pragma = http_get_next_field( http_hdr );
>  	}
> -	asf_http_ctrl->streaming_type = asf_http_streaming_type(
> content_type, features, http_hdr, asf_http_ctrl->request );
> +	asf_http_ctrl->streaming_type = asf_http_streaming_type(
> content_type, features, http_hdr );
>  	return 0;
>  }
>  
> > _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> 


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com




More information about the MPlayer-dev-eng mailing list