# HG changeset patch # User rtognimp # Date 1104263996 0 # Node ID bc8152b52771d55b0cb2292657aad0c1c236c0d1 # Parent cb5fbade8a5c7e7f247ff27622640502a8e22122 Try http if pnm connection fails Fixes pnm://www.darrelbowen.com/videos/commercials256.rm diff -r cb5fbade8a5c -r bc8152b52771 libmpdemux/network.c --- a/libmpdemux/network.c Tue Dec 28 19:11:14 2004 +0000 +++ b/libmpdemux/network.c Tue Dec 28 19:59:56 2004 +0000 @@ -998,7 +998,7 @@ if(fd<0) return -1; pnm = pnm_connect(fd,stream->streaming_ctrl->url->file); - if(!pnm) return -1; + if(!pnm) return -2; stream->fd=fd; stream->streaming_ctrl->data=pnm; @@ -1250,6 +1250,10 @@ if( !strcasecmp( stream->streaming_ctrl->url->protocol, "pnm")) { stream->fd = -1; ret = pnm_streaming_start( stream ); + if (ret == -1) { + mp_msg(MSGT_NETWORK,MSGL_INFO,"Can't connect with pnm, retrying with http.\n"); + goto stream_switch; + } } else if( (!strcasecmp( stream->streaming_ctrl->url->protocol, "rtsp")) && @@ -1259,7 +1263,7 @@ mp_msg(MSGT_NETWORK,MSGL_INFO,"Not a Realmedia rtsp url. Trying standard rtsp protocol.\n"); #ifdef STREAMING_LIVE_DOT_COM *demuxer_type = DEMUXER_TYPE_RTP; - goto try_livedotcom; + goto stream_switch; #else mp_msg(MSGT_NETWORK,MSGL_ERR,"RTSP support requires the \"LIVE.COM Streaming Media\" libraries!\n"); return -1; @@ -1268,7 +1272,7 @@ } else // For connection-oriented streams, we can usually determine the streaming type. -try_livedotcom: +stream_switch: switch( *demuxer_type ) { case DEMUXER_TYPE_ASF: // Send the appropriate HTTP request