From 9698bd80061a79c7f9e6940d2cfba7d34cd4c120 Mon Sep 17 00:00:00 2001 From: dooglus Date: Wed, 24 Oct 2007 01:14:38 +0000 Subject: [PATCH] popen() doesn't like type "rb" on Linux, either. git-svn-id: http://svn.voria.com/code@959 1f10aa63-cdf2-0310-b900-c93c546f37ac --- ETL/trunk/ETL/_stringf.h | 2 ++ synfig-core/trunk/src/modules/mod_ffmpeg/mptr_ffmpeg.cpp | 2 +- synfig-core/trunk/src/modules/mod_imagemagick/mptr_imagemagick.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ETL/trunk/ETL/_stringf.h b/ETL/trunk/ETL/_stringf.h index aaa87fd..dfc4bcf 100644 --- a/ETL/trunk/ETL/_stringf.h +++ b/ETL/trunk/ETL/_stringf.h @@ -41,8 +41,10 @@ #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 diff --git a/synfig-core/trunk/src/modules/mod_ffmpeg/mptr_ffmpeg.cpp b/synfig-core/trunk/src/modules/mod_ffmpeg/mptr_ffmpeg.cpp index cd38376..bc4cc7b 100644 --- a/synfig-core/trunk/src/modules/mod_ffmpeg/mptr_ffmpeg.cpp +++ b/synfig-core/trunk/src/modules/mod_ffmpeg/mptr_ffmpeg.cpp @@ -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) { diff --git a/synfig-core/trunk/src/modules/mod_imagemagick/mptr_imagemagick.cpp b/synfig-core/trunk/src/modules/mod_imagemagick/mptr_imagemagick.cpp index 4d8a08c..a077230 100644 --- a/synfig-core/trunk/src/modules/mod_imagemagick/mptr_imagemagick.cpp +++ b/synfig-core/trunk/src/modules/mod_imagemagick/mptr_imagemagick.cpp @@ -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) { -- 2.7.4