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

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


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

Modified:
   liboggplay/trunk/src/liboggplay/oggplay_file_reader.c
Log:
modified file_reader implementation to take in a file name on creation



Modified: liboggplay/trunk/src/liboggplay/oggplay_file_reader.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_file_reader.c	2007-06-18 08:20:01 UTC (rev 2981)
+++ liboggplay/trunk/src/liboggplay/oggplay_file_reader.c	2007-06-18 08:20:27 UTC (rev 2982)
@@ -44,7 +44,7 @@
 #include <string.h>
 
 OggPlayErrorCode
-oggplay_file_reader_initialise(OggPlayReader * opr, char * file_name, int block) {
+oggplay_file_reader_initialise(OggPlayReader * opr, int block) {
 
   OggPlayFileReader * me = (OggPlayFileReader *)opr;
   (void)block; /* unused for file readers */
@@ -53,8 +53,7 @@
     return E_OGGPLAY_BAD_READER;
   }
   
-  me->file_name = file_name;
-  me->file = fopen(file_name, "rb");
+  me->file = fopen(me->file_name, "rb");
 
   if (me->file == NULL) {
     return E_OGGPLAY_BAD_INPUT;
@@ -160,12 +159,12 @@
 }
 
 OggPlayReader *
-oggplay_file_reader_new(void) {
+oggplay_file_reader_new(char *file_name) {
 
   OggPlayFileReader * me = malloc (sizeof (OggPlayFileReader));
 
   me->current_position = 0;
-  me->file_name = NULL;
+  me->file_name = file_name;
   me->file = NULL;
 
   me->functions.initialise = &oggplay_file_reader_initialise;



More information about the commits mailing list