[Mplayer-cvslog] CVS: main/libmenu menu.c,1.5,1.6

Arpi of Ize arpi at mplayerhq.hu
Sat Dec 28 14:46:57 CET 2002


Update of /cvsroot/mplayer/main/libmenu
In directory mail:/var/tmp.root/cvs-serv8298

Modified Files:
	menu.c 
Log Message:
This patch fixes the reading of the menu.conf, because stream_open()
isn't a good idea, it messes with dvd playback.
Andreas Hess <jaska at gmx.net>


Index: menu.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmenu/menu.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- menu.c	22 Nov 2002 12:01:59 -0000	1.5
+++ menu.c	28 Dec 2002 13:46:55 -0000	1.6
@@ -4,6 +4,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
 
 #include "../libvo/osd.h"
 #include "../libvo/font_load.h"
@@ -115,8 +117,8 @@
   char* buffer = NULL;
   int bl = BUF_STEP, br = 0;
   int f;
-  stream_t* stream = open_stream(cfg_file,0,&f);
-  if(!stream) {
+  int fd = open(cfg_file, O_RDONLY);
+  if(fd < 0) {
     printf("Can't open menu config file: %s\n",cfg_file);
     return 0;
   }
@@ -126,14 +128,14 @@
     if(bl - br < BUF_MIN) {
       if(bl >= BUF_MAX) {
 	printf("Menu config file is too big (> %d KB)\n",BUF_MAX/1024);
-	free_stream(stream);
+	close(fd);
 	free(buffer);
 	return 0;
       }
       bl += BUF_STEP;
       buffer = realloc(buffer,bl);
     }
-    r = stream_read(stream,buffer+br,bl-br);
+    r = read(fd,buffer+br,bl-br);
     if(r == 0) break;
     br += r;
   }
@@ -142,6 +144,8 @@
     return 0;
   }
   buffer[br-1] = '\0';
+
+  close(fd);
 
   f = menu_parse_config(buffer);
   free(buffer);




More information about the MPlayer-cvslog mailing list