[rtmpdump] r22 - rtmpdump.cpp
hyc
subversion at mplayerhq.hu
Fri Nov 6 04:36:14 CET 2009
Author: hyc
Date: Fri Nov 6 04:36:13 2009
New Revision: 22
Log:
Set stdout to binary mode for WIN32
Modified:
rtmpdump.cpp
Modified: rtmpdump.cpp
==============================================================================
--- rtmpdump.cpp Fri Nov 6 04:32:22 2009 (r21)
+++ rtmpdump.cpp Fri Nov 6 04:36:13 2009 (r22)
@@ -28,8 +28,13 @@
#ifdef WIN32
#include <winsock.h>
+#include <io.h>
+#define SET_BINMODE(f) setmode(fileno(f), O_BINARY)
+#else
+#define SET_BINMODE(f)
#endif
+
#include "rtmp.h"
#include "log.h"
#include "AMFObject.h"
@@ -1218,9 +1223,10 @@ int main(int argc, char **argv)
}
if (!file) {
- if(bStdoutMode)
+ if(bStdoutMode) {
file = stdout;
- else
+ SET_BINMODE(file);
+ } else
{
file = fopen(flvFile, "w+b");
if(file == 0) {
More information about the rtmpdump
mailing list