Mercurial > mplayer.hg
comparison libvo/vo_mpegpes.c @ 2066:2b14cad013b7
using poll() only for DVB card - not required for file write
author | arpi |
---|---|
date | Wed, 03 Oct 2001 23:34:15 +0000 |
parents | b1d663f54725 |
children | b2ce5d6d7d4f |
comparison
equal
deleted
inserted
replaced
2065:147e114e906b | 2066:2b14cad013b7 |
---|---|
19 #include <string.h> | 19 #include <string.h> |
20 | 20 |
21 #include <sys/types.h> | 21 #include <sys/types.h> |
22 #include <sys/stat.h> | 22 #include <sys/stat.h> |
23 #include <fcntl.h> | 23 #include <fcntl.h> |
24 | |
25 #ifdef HAVE_DVB | |
26 | |
24 #include <sys/poll.h> | 27 #include <sys/poll.h> |
25 | |
26 #ifdef HAVE_DVB | |
27 | 28 |
28 #include <sys/ioctl.h> | 29 #include <sys/ioctl.h> |
29 #include <stdio.h> | 30 #include <stdio.h> |
30 #include <time.h> | 31 #include <time.h> |
31 #include <unistd.h> | 32 #include <unistd.h> |
249 vo_draw_text(osd_w,osd_h,draw_alpha); | 250 vo_draw_text(osd_w,osd_h,draw_alpha); |
250 } | 251 } |
251 #endif | 252 #endif |
252 } | 253 } |
253 | 254 |
255 | |
256 static void my_write(unsigned char* data,int len){ | |
257 #ifdef HAVE_DVB | |
254 #define NFD 2 | 258 #define NFD 2 |
255 | |
256 static void my_write(unsigned char* data,int len){ | |
257 struct pollfd pfd[NFD]; | 259 struct pollfd pfd[NFD]; |
258 | 260 |
259 // printf("write %d bytes \n",len); | 261 // printf("write %d bytes \n",len); |
260 | 262 |
261 pfd[0].fd = vo_mpegpes_fd; | 263 pfd[0].fd = vo_mpegpes_fd; |
276 len-=ret; data+=ret; | 278 len-=ret; data+=ret; |
277 } | 279 } |
278 } else usleep(1000); | 280 } else usleep(1000); |
279 } | 281 } |
280 } | 282 } |
283 | |
284 #else | |
285 write(vo_mpegpes_fd,data,len); // write to file | |
286 #endif | |
281 } | 287 } |
282 | 288 |
283 static unsigned char pes_header[PES_MAX_SIZE]; | 289 static unsigned char pes_header[PES_MAX_SIZE]; |
284 | 290 |
285 static void send_pes_packet(unsigned char* data,int len,int id,int timestamp){ | 291 static void send_pes_packet(unsigned char* data,int len,int id,int timestamp){ |