[Mplayer-cvslog] CVS: main mplayer.c,1.121,1.122

Bertrand Baudet bertrand at users.sourceforge.net
Sun May 20 15:06:35 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv30242

Modified Files:
	mplayer.c 
Log Message:
Now Check if the 'filename' is an URL and connect to the server.


Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -C2 -r1.121 -r1.122
*** mplayer.c	2001/05/16 23:04:22	1.121
--- mplayer.c	2001/05/20 13:06:33	1.122
***************
*** 90,93 ****
--- 90,99 ----
  #include "help_mp.h"
  
+ #ifdef STREAMING
+ #include "url.h"
+ #include "network.h"
+ static URL_t* url;
+ #endif
+ 
  #define DEBUG if(0)
  #ifdef HAVE_GUI
***************
*** 649,657 ****
        stream=new_stream(f,STREAMTYPE_STREAM);
    } else {
!       f=open(filename,O_RDONLY);
!       if(f<0){ printf("File not found: '%s'\n",filename);return 1; }
!       len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET);
!       stream=new_stream(f,STREAMTYPE_FILE);
!       stream->end_pos=len;
    }
  }
--- 655,686 ----
        stream=new_stream(f,STREAMTYPE_STREAM);
    } else {
! #ifdef STREAMING
!       url = set_url(filename);
!       if(url==NULL) {
! #endif
!        f=open(filename,O_RDONLY);
!        if(f<0){ printf("File not found: '%s'\n",filename);return 1; }
!        len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET);
!        stream=new_stream(f,STREAMTYPE_FILE);
!        stream->end_pos=len;
! #ifdef STREAMING
!       } else {
!         if(url->port==0) {
!           if( (!strcasecmp(url->protocol, "mms")) || 
!               (!strcasecmp(url->protocol, "http")) ){
!             url->port=80;
!           }
!         }
!         f=connect2Server(url->hostname, url->port);
!         if( f<0 ) { 
!           printf("Unable to open URL: %s\n", filename);
!           free_url(url);
!           return 1; 
!         } else {
!           printf("Connected to server: %s\n", url->hostname );
!         }
!         stream=new_stream(f,STREAMTYPE_STREAM);
!       }
! #endif
    }
  }


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list