popen() doesn't like type "rb" on Linux, either.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 24 Oct 2007 01:14:38 +0000 (01:14 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 24 Oct 2007 01:14:38 +0000 (01:14 +0000)
git-svn-id: http://svn.voria.com/code@959 1f10aa63-cdf2-0310-b900-c93c546f37ac

ETL/trunk/ETL/_stringf.h
synfig-core/trunk/src/modules/mod_ffmpeg/mptr_ffmpeg.cpp
synfig-core/trunk/src/modules/mod_imagemagick/mptr_imagemagick.cpp

index aaa87fd..dfc4bcf 100644 (file)
 #endif
 
 #ifdef WIN32
+#define POPEN_BINARY_READ_TYPE "rb"
 #define POPEN_BINARY_WRITE_TYPE "wb"
 #else
+#define POPEN_BINARY_READ_TYPE "r"
 #define POPEN_BINARY_WRITE_TYPE "w"
 #endif
 
index cd38376..bc4cc7b 100644 (file)
@@ -70,7 +70,7 @@ ffmpeg_mptr::seek_to(int frame)
 
                command=strprintf("ffmpeg -i \"%s\" -an -f image2pipe -vcodec ppm -\n",filename.c_str());
 
-               file=popen(command.c_str(),"rb");
+               file=popen(command.c_str(),POPEN_BINARY_READ_TYPE);
 
                if(!file)
                {
index 4d8a08c..a077230 100644 (file)
@@ -173,7 +173,7 @@ imagemagick_mptr::get_frame(synfig::Surface &surface,Time /*time*/, synfig::Prog
 
        command=strprintf("convert \"%s\" -flatten ppm:-\n",filename.c_str());
 
-       file=popen(command.c_str(),"rb");
+       file=popen(command.c_str(),POPEN_BINARY_READ_TYPE);
 
        if(!file)
        {