changeset 12390:338e9d30be5e

Try to get an asf file with normal http protocol if http streaming fail. Patch by adland
author rtognimp
date Sat, 01 May 2004 23:35:25 +0000
parents 0b1053e9d8da
children 2677bfac3838
files libmpdemux/network.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/network.c	Sat May 01 21:19:20 2004 +0000
+++ b/libmpdemux/network.c	Sat May 01 23:35:25 2004 +0000
@@ -1259,8 +1259,20 @@
 			// so we need to pass demuxer_type too
 			ret = asf_streaming_start( stream, demuxer_type );
 			if( ret<0 ) {
+                                //sometimes a file is just on a webserver and it is not streamed.
+				//try loading them default method as last resort for http protocol
+                                if ( !strcasecmp(stream->streaming_ctrl->url->protocol, "http") ) {
+                                mp_msg(MSGT_NETWORK,MSGL_STATUS,"Trying default streaming for http protocol\n ");
+                                //reset stream
+                                close(stream->fd);
+		                stream->fd=-1;
+                                ret=nop_streaming_start(stream);
+                                }
+
+                         if (ret<0) {
 				mp_msg(MSGT_NETWORK,MSGL_ERR,"asf_streaming_start failed\n");
                                 mp_msg(MSGT_NETWORK,MSGL_STATUS,"Check if this is a playlist which requires -playlist option\nExample: mplayer -playlist <url>\n");
+                               }
 			}
 			break;
 #ifdef STREAMING_LIVE_DOT_COM