Mercurial > libavformat.hg
comparison img.c @ 12:d58c983a19a7 libavformat
redid usleep() fix for BeOS, more consistant with the MINGW32 one. removed a TAB :P
author | mmu_man |
---|---|
date | Fri, 20 Dec 2002 21:04:08 +0000 |
parents | 932b59c66c60 |
children | 3d52de18ecc3 |
comparison
equal
deleted
inserted
replaced
11:932b59c66c60 | 12:d58c983a19a7 |
---|---|
15 * You should have received a copy of the GNU Lesser General Public | 15 * You should have received a copy of the GNU Lesser General Public |
16 * License along with this library; if not, write to the Free Software | 16 * License along with this library; if not, write to the Free Software |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 */ | 18 */ |
19 #include <unistd.h> | 19 #include <unistd.h> |
20 #ifdef __BEOS__ | |
21 # include <OS.h> | |
22 #endif | |
23 #include "avformat.h" | 20 #include "avformat.h" |
24 | 21 |
25 extern AVInputFormat pgm_iformat; | 22 extern AVInputFormat pgm_iformat; |
26 extern AVOutputFormat pgm_oformat; | 23 extern AVOutputFormat pgm_oformat; |
27 extern AVInputFormat pgmyuv_iformat; | 24 extern AVInputFormat pgmyuv_iformat; |
38 extern AVOutputFormat ppmpipe_oformat; | 35 extern AVOutputFormat ppmpipe_oformat; |
39 extern AVOutputFormat yuv4mpegpipe_oformat; | 36 extern AVOutputFormat yuv4mpegpipe_oformat; |
40 | 37 |
41 #ifdef __MINGW32__ | 38 #ifdef __MINGW32__ |
42 # include <windows.h> | 39 # include <windows.h> |
43 # define usleep(t) Sleep((t) / 1000) | 40 # define usleep(t) Sleep((t) / 1000) |
41 #endif | |
42 #ifdef __BEOS__ | |
43 # ifndef usleep | |
44 # include <OS.h> | |
45 # define usleep(t) snooze((bigtime_t)(t)) | |
46 # endif | |
44 #endif | 47 #endif |
45 | 48 |
46 #define IMGFMT_YUV 1 | 49 #define IMGFMT_YUV 1 |
47 #define IMGFMT_PGMYUV 2 | 50 #define IMGFMT_PGMYUV 2 |
48 #define IMGFMT_PGM 3 | 51 #define IMGFMT_PGM 3 |
213 nowus = av_gettime() - first_frame; | 216 nowus = av_gettime() - first_frame; |
214 | 217 |
215 pts = ((INT64)s->img_number * FRAME_RATE_BASE * 1000000) / (s1->streams[0]->codec.frame_rate); | 218 pts = ((INT64)s->img_number * FRAME_RATE_BASE * 1000000) / (s1->streams[0]->codec.frame_rate); |
216 | 219 |
217 if (pts > nowus) | 220 if (pts > nowus) |
218 #ifdef __BEOS__ | |
219 snooze((bigtime_t)(pts - nowus)); | |
220 #else | |
221 usleep(pts - nowus); | 221 usleep(pts - nowus); |
222 #endif | |
223 } | 222 } |
224 } | 223 } |
225 | 224 |
226 /* | 225 /* |
227 This if-statement destroys pipes - I do not see why it is necessary | 226 This if-statement destroys pipes - I do not see why it is necessary |