1 |
--- mplex/main.cpp.orig Wed Jun 20 13:40:39 2007 |
2 |
+++ mplex/main.cpp Wed Jun 20 13:41:49 2007 |
3 |
@@ -38,6 +38,7 @@ |
4 |
#endif |
5 |
#include <ctype.h> |
6 |
#include <math.h> |
7 |
+#include <fcntl.h> |
8 |
#include "cpu_accel.h" |
9 |
#include "mjpeg_types.h" |
10 |
#include "mjpeg_logging.h" |
11 |
@@ -107,6 +108,14 @@ |
12 |
{ |
13 |
mjpeg_error_exit1( "Could not open for writing: %s", cur_filename ); |
14 |
} |
15 |
+ { |
16 |
+ int flags; |
17 |
+ |
18 |
+ (void)fcntl(fileno(strm), F_GETFL, &flags); |
19 |
+ (void)fcntl(fileno(strm), F_SETFL, flags & ~O_NONBLOCK); |
20 |
+ } |
21 |
+ |
22 |
+ |
23 |
|
24 |
return 0; |
25 |
} |
26 |
@@ -143,6 +152,13 @@ |
27 |
mjpeg_error_exit1( "Could not open for writing: %s", cur_filename ); |
28 |
} |
29 |
segment_len = 0; |
30 |
+ { |
31 |
+ int flags; |
32 |
+ |
33 |
+ (void)fcntl(fileno(strm), F_GETFL, &flags); |
34 |
+ (void)fcntl(fileno(strm), F_SETFL, flags & ~O_NONBLOCK); |
35 |
+ } |
36 |
+ |
37 |
} |
38 |
|
39 |
void |
40 |
@@ -200,6 +216,14 @@ |
41 |
{ |
42 |
mjpeg_error_exit1( "Unable to open file %s for reading.", bs_filename); |
43 |
} |
44 |
+ |
45 |
+ { |
46 |
+ int flags; |
47 |
+ |
48 |
+ (void)fcntl(fileno(fileh), F_GETFL, &flags); |
49 |
+ (void)fcntl(fileno(fileh), F_SETFL, flags & ~O_NONBLOCK); |
50 |
+ } |
51 |
+ |
52 |
filename = strcpy( new char[strlen(bs_filename)+1], bs_filename ); |
53 |
streamname = filename; |
54 |
|