mirror of
https://github.com/mpv-player/mpv
synced 2025-08-20 09:22:07 +02:00
DOCS
TOOLS
GL-test
alaw-gen.c
asfinfo.c
audio-block.c
audio-block2.c
audio-select.c
blocking.c
buffer.c
c
cache.c
fastmem.sh
fastmemcpybench.c
movinfo.c
perlbench.pl
png2raw.c
TVout
debian
drivers
liba52
libao2
libmpeg2
libvo
linux
loader
mp3lib
xa
.cvsignore
Makefile
alaw.h
asf.h
asf_streaming.c
asfheader.c
aviheader.c
aviprint.c
aviwrite.c
cfg-mplayer-def.h
cfg-mplayer.h
cfgparser.c
cfgparser.h
codec-cfg.c
codec-cfg.h
codecctrl.c
configure
configure.FreeBSD
dec_audio.c
demux_asf.c
demux_avi.c
demux_mpg.c
demuxer.c
demuxer.h
dll_init.c
dvdauth.c
dvdauth.h
fifo.c
find_sub.c
help_avp.h
help_mp.h
http.c
http.h
lirc_mp.c
lirc_mp.h
mixer.c
mixer.h
mplayer.c
mplayer.h
network.c
network.h
parse_es.c
spudec.c
spudec.h
stheader.h
stream.c
stream.h
subreader.c
subreader.h
tvision.c
url.c
url.h
vcd_read.h
vcd_read_fbsd.h
version.sh
videodev.h

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@917 b3059339-0415-0410-9bf9-f77b7e298cf2
48 lines
1016 B
C
48 lines
1016 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <sys/time.h>
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
#include <sys/stat.h>
|
|
#include <fcntl.h>
|
|
|
|
#define BUFFSIZE (32*65536)
|
|
|
|
unsigned char *buffer[1];
|
|
|
|
int main(int argc,char* argv[]){
|
|
|
|
fd_set rfds;
|
|
struct timeval tv;
|
|
int retval;
|
|
int in_fd=0; // stdin
|
|
|
|
buffer[0]=malloc(BUFFSIZE);
|
|
|
|
if(argc>1) in_fd=open(argv[1],O_RDONLY|O_NONBLOCK);
|
|
|
|
while(1){
|
|
FD_ZERO(&rfds); FD_SET(in_fd, &rfds);
|
|
tv.tv_sec = 1;
|
|
tv.tv_usec = 0;
|
|
retval = select(in_fd+1, &rfds, NULL, NULL, &tv);
|
|
|
|
if (retval){
|
|
if(FD_ISSET(in_fd, &rfds)){
|
|
// we can read input.
|
|
int len;
|
|
fprintf(stderr,"r");fflush(stderr);
|
|
len=read(in_fd,buffer[0],BUFFSIZE);
|
|
fprintf(stderr,"(%d)",len);fflush(stderr);
|
|
}
|
|
} else {
|
|
fprintf(stderr,".");fflush(stderr);
|
|
}
|
|
|
|
fprintf(stderr,"\n");fflush(stderr);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|