summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-24 09:29:52 +0000
committerbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-24 09:29:52 +0000
commite0d25103375de8ab0b6660eade7734cd569c1e2f (patch)
tree6870a332dbdb8af5a25603a30ca33ed64713c61b
parentbd45bf098fa7a0f07bc73482fddce3ee9056d369 (diff)
downloadmpv-e0d25103375de8ab0b6660eade7734cd569c1e2f.tar.bz2
mpv-e0d25103375de8ab0b6660eade7734cd569c1e2f.tar.xz
Readded the content-type checking, in case of the no HTTP body are
sent we can still try with the content-type. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4335 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libmpdemux/asf_streaming.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/libmpdemux/asf_streaming.c b/libmpdemux/asf_streaming.c
index 6336b655ab..0e53e50e37 100644
--- a/libmpdemux/asf_streaming.c
+++ b/libmpdemux/asf_streaming.c
@@ -370,31 +370,32 @@ asf_http_streaming_type(char *content_type, char *features, HTTP_header_t *http_
// so we could used mime type to know the stream type,
// but guess what? All of them are not well configured.
// So we have to check for an asf header :(, but it works :p
- if( asf_header_check( http_hdr )==0 ) {
- printf("=====> ASF Plain text\n");
- return ASF_PlainText_e;
- } else {
- printf("=====> ASF Redirector\n");
- return ASF_Redirector_e;
- }
-/*
- if( (!strcasecmp(content_type, "audio/x-ms-wax")) ||
- (!strcasecmp(content_type, "audio/x-ms-wma")) ||
- (!strcasecmp(content_type, "video/x-ms-asf")) ||
- (!strcasecmp(content_type, "video/x-ms-afs")) ||
- (!strcasecmp(content_type, "video/x-ms-wvx")) ||
- (!strcasecmp(content_type, "video/x-ms-wmv")) ||
- (!strcasecmp(content_type, "video/x-ms-wma")) ) {
- printf("=====> ASF Redirector\n");
- return ASF_Redirector_e;
- } else if( !strcasecmp(content_type, "text/plain") ) {
- printf("=====> ASF Plain text\n");
- return ASF_PlainText_e;
+ if( http_hdr->body_size>sizeof(ASF_obj_header_t) ) {
+ if( asf_header_check( http_hdr )==0 ) {
+ printf("=====> ASF Plain text\n");
+ return ASF_PlainText_e;
+ } else {
+ printf("=====> ASF Redirector\n");
+ return ASF_Redirector_e;
+ }
} else {
- printf("=====> ASF unknown content-type: %s\n", content_type );
- return ASF_Unknown_e;
+ if( (!strcasecmp(content_type, "audio/x-ms-wax")) ||
+ (!strcasecmp(content_type, "audio/x-ms-wma")) ||
+ (!strcasecmp(content_type, "video/x-ms-asf")) ||
+ (!strcasecmp(content_type, "video/x-ms-afs")) ||
+ (!strcasecmp(content_type, "video/x-ms-wvx")) ||
+ (!strcasecmp(content_type, "video/x-ms-wmv")) ||
+ (!strcasecmp(content_type, "video/x-ms-wma")) ) {
+ printf("=====> ASF Redirector\n");
+ return ASF_Redirector_e;
+ } else if( !strcasecmp(content_type, "text/plain") ) {
+ printf("=====> ASF Plain text\n");
+ return ASF_PlainText_e;
+ } else {
+ printf("=====> ASF unknown content-type: %s\n", content_type );
+ return ASF_Unknown_e;
+ }
}
-*/
}
return ASF_Unknown_e;
}