[xiph-commits] r2981 - liboggplay/trunk/src/liboggplay

shans at svn.annodex.net shans at svn.annodex.net
Mon Jun 18 01:20:01 PDT 2007


Author: shans
Date: 2007-06-18 01:20:01 -0700 (Mon, 18 Jun 2007)
New Revision: 2981

Modified:
   liboggplay/trunk/src/liboggplay/oggplay_tcp_reader.c
   liboggplay/trunk/src/liboggplay/oggplay_tcp_reader.h
Log:
Modified tcp_reader to store location passed in on creation



Modified: liboggplay/trunk/src/liboggplay/oggplay_tcp_reader.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_tcp_reader.c	2007-06-18 08:19:14 UTC (rev 2980)
+++ liboggplay/trunk/src/liboggplay/oggplay_tcp_reader.c	2007-06-18 08:20:01 UTC (rev 2981)
@@ -100,7 +100,7 @@
   }
 
 OggPlayErrorCode
-oggplay_tcp_reader_initialise(OggPlayReader * opr, char * location, int block) {
+oggplay_tcp_reader_initialise(OggPlayReader * opr, int block) {
 
   OggPlayTCPReader    * me = (OggPlayTCPReader *)opr;
   struct hostent      * he;
@@ -174,9 +174,9 @@
   /*
    * Extract the host name and the path from the location.
    */
-  len = strlen(location);
+  len = strlen(me->location);
   _location = (char*)malloc(len + 2);
-  strcpy(_location, location);
+  strcpy(_location, me->location);
 
   if (strncmp(_location, "http://", 7) == 0) {
     path = strchr(_location + 7, '/');
@@ -518,7 +518,7 @@
 
 
 OggPlayReader *
-oggplay_tcp_reader_new(void) {
+oggplay_tcp_reader_new(char *location) {
 
   OggPlayTCPReader * me = (OggPlayTCPReader *)malloc (sizeof (OggPlayTCPReader));
 
@@ -527,6 +527,7 @@
   me->buffer = NULL;
   me->buffer_size = 0;
   me->current_position = 0;
+  me->location = strdup(location);
 
   me->functions.initialise = &oggplay_tcp_reader_initialise;
   me->functions.destroy = &oggplay_tcp_reader_destroy;

Modified: liboggplay/trunk/src/liboggplay/oggplay_tcp_reader.h
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_tcp_reader.h	2007-06-18 08:19:14 UTC (rev 2980)
+++ liboggplay/trunk/src/liboggplay/oggplay_tcp_reader.h	2007-06-18 08:20:01 UTC (rev 2981)
@@ -64,6 +64,7 @@
   unsigned char   * buffer;
   int               buffer_size;
   int               current_position;
+  char            * location;
 } OggPlayTCPReader;
 
 #endif



More information about the commits mailing list