mirror of
https://github.com/mpv-player/mpv
synced 2025-03-22 03:08:33 +00:00
Fix when stdin is used as a file
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4893 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
356da44ecd
commit
7027f14002
@ -634,6 +634,7 @@ mp_input_read_keys(int time,int paused) {
|
||||
if((unsigned int)i >= num_key_fd) {
|
||||
i = -1;
|
||||
last_loop++;
|
||||
last_loop %= (num_key_fd+1);
|
||||
continue;
|
||||
}
|
||||
// No input from this fd
|
||||
@ -785,6 +786,7 @@ mp_input_read_cmds(int time) {
|
||||
if((unsigned int)i >= num_cmd_fd) {
|
||||
i = -1;
|
||||
last_loop++;
|
||||
last_loop %= (num_cmd_fd+1);
|
||||
continue;
|
||||
}
|
||||
if( ! (cmd_fds[i].flags & MP_FD_NO_SELECT) && ! FD_ISSET(cmd_fds[i].fd,&fds) && ! (cmd_fds[i].flags & MP_FD_GOT_CMD) )
|
||||
|
20
mplayer.c
20
mplayer.c
@ -163,7 +163,7 @@ int frameratecode2framerate[16] = {
|
||||
|
||||
// Common FIFO functions, and keyboard/event FIFO code
|
||||
#include "fifo.c"
|
||||
|
||||
int use_stdin=0;
|
||||
//**************************************************************************//
|
||||
|
||||
#ifdef USE_LIBVO2
|
||||
@ -274,8 +274,6 @@ static int screen_size_y=0;//SCREEN_SIZE_Y;
|
||||
static int screen_size_xy=0;
|
||||
static float movie_aspect=-1.0;
|
||||
|
||||
char* playlist_file;
|
||||
|
||||
// sub:
|
||||
char *font_name=NULL;
|
||||
float font_factor=0.75;
|
||||
@ -512,7 +510,6 @@ int rtc_fd=-1;
|
||||
//float a_frame=0; // Audio
|
||||
|
||||
int i;
|
||||
int use_stdin=0; //int f; // filedes
|
||||
|
||||
int gui_no_filename=0;
|
||||
|
||||
@ -734,7 +731,7 @@ if(keyb_fifo_get > 0)
|
||||
mp_input_add_key_fd(keyb_fifo_get,1,NULL,NULL);
|
||||
if(slave_mode)
|
||||
mp_input_add_cmd_fd(0,1,NULL,NULL);
|
||||
else
|
||||
else if(!use_stdin)
|
||||
mp_input_add_key_fd(0,1,NULL,NULL);
|
||||
inited_flags|=INITED_INPUT;
|
||||
current_module = NULL;
|
||||
@ -936,19 +933,6 @@ play_dvd:
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_NEW_INPUT
|
||||
if(!slave_mode && filename && !use_stdin && !strcmp(filename,"-")) {
|
||||
mp_input_rm_key_fd(0);
|
||||
use_stdin = 1;
|
||||
}
|
||||
else if(!slave_mode && use_stdin && (!filename || strcmp(filename,"-"))) {
|
||||
mp_input_add_key_fd(0,1,NULL,NULL);
|
||||
use_stdin = 0;
|
||||
}
|
||||
#else
|
||||
use_stdin=filename && (!strcmp(filename,"-"));
|
||||
#endif
|
||||
|
||||
current_module="open_stream";
|
||||
stream=open_stream(filename,vcd_track,&file_format);
|
||||
if(!stream) { // error...
|
||||
|
Loading…
Reference in New Issue
Block a user