summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-29 15:12:19 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-29 15:36:51 +0300
commit77ec83e351ca7218464f8f77a711520d68fa2e5d (patch)
treea34d66134176ded3eeff149c756eecfd0ea52304 /osdep
parentf59cda84b1e52293e656fffea1529896d28b2d21 (diff)
downloadmpv-77ec83e351ca7218464f8f77a711520d68fa2e5d.tar.bz2
mpv-77ec83e351ca7218464f8f77a711520d68fa2e5d.tar.xz
Add a context for mp_fifo
Store data in an allocated context and take it as an argument instead of using static variables.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/getch2-os2.c4
-rw-r--r--osdep/getch2-win.c4
-rw-r--r--osdep/getch2.c4
-rw-r--r--osdep/getch2.h3
4 files changed, 8 insertions, 7 deletions
diff --git a/osdep/getch2-os2.c b/osdep/getch2-os2.c
index 58ea0c01bc..c309a22bce 100644
--- a/osdep/getch2-os2.c
+++ b/osdep/getch2-os2.c
@@ -164,13 +164,13 @@ static int getch2_internal( void )
return -1;
}
-void getch2( void )
+void getch2(struct mp_fifo *fifo)
{
int key;
key = getch2_internal();
if( key != -1 )
- mplayer_put_key( key );
+ mplayer_put_key(fifo, key);
}
void getch2_enable( void )
diff --git a/osdep/getch2-win.c b/osdep/getch2-win.c
index a939784266..4d42bec878 100644
--- a/osdep/getch2-win.c
+++ b/osdep/getch2-win.c
@@ -121,11 +121,11 @@ static int getch2_internal(void)
return -1;
}
-void getch2(void)
+void getch2(struct mp_fifo *fifo)
{
int r = getch2_internal();
if (r >= 0)
- mplayer_put_key(r);
+ mplayer_put_key(fifo, r);
}
void getch2_enable(){
diff --git a/osdep/getch2.c b/osdep/getch2.c
index 663b2350f9..cff61d3847 100644
--- a/osdep/getch2.c
+++ b/osdep/getch2.c
@@ -135,7 +135,7 @@ void get_screen_size(void){
#endif
}
-void getch2(void)
+void getch2(struct mp_fifo *fifo)
{
int retval = read(0, &getch2_buf[getch2_len], BUF_LEN-getch2_len);
if (retval < 1)
@@ -244,7 +244,7 @@ void getch2(void)
getch2_len -= len;
for (i = 0; i < getch2_len; i++)
getch2_buf[i] = getch2_buf[len+i];
- mplayer_put_key(code);
+ mplayer_put_key(fifo, code);
}
}
diff --git a/osdep/getch2.h b/osdep/getch2.h
index b91bd7176d..852206bd8e 100644
--- a/osdep/getch2.h
+++ b/osdep/getch2.h
@@ -22,7 +22,8 @@ extern void getch2_enable(void);
extern void getch2_disable(void);
/* Read a character or a special key code (see keycodes.h) */
-extern void getch2(void);
+struct mp_fifo;
+extern void getch2(struct mp_fifo *fifo);
/* slave cmd function for Windows and OS/2 */
extern int mp_input_slave_cmd_func(int fd,char* dest,int size);