summaryrefslogtreecommitdiffstats
path: root/libmenu
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-28 13:46:55 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-28 13:46:55 +0000
commitcfa30a8b32d474ac2718831804caf5218dc430d3 (patch)
tree881a92ae4eec665d09718bde7c0e7493ce68b184 /libmenu
parentbd814ee8795a74ae0710d54c3d5e559401b171b3 (diff)
downloadmpv-cfa30a8b32d474ac2718831804caf5218dc430d3.tar.bz2
mpv-cfa30a8b32d474ac2718831804caf5218dc430d3.tar.xz
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@gmx.net> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8605 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmenu')
-rw-r--r--libmenu/menu.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libmenu/menu.c b/libmenu/menu.c
index d807b0ee03..87898c0b4b 100644
--- a/libmenu/menu.c
+++ b/libmenu/menu.c
@@ -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 @@ int menu_init(char* cfg_file) {
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 @@ int menu_init(char* cfg_file) {
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;
}
@@ -143,6 +145,8 @@ int menu_init(char* cfg_file) {
}
buffer[br-1] = '\0';
+ close(fd);
+
f = menu_parse_config(buffer);
free(buffer);
return f;