From aaa0275b0e9c8a981a01dad6d841c40e7d8d77c2 Mon Sep 17 00:00:00 2001 From: pabs Date: Wed, 17 Oct 2007 05:47:23 +0000 Subject: [PATCH] Fix the ffmpeg/dv/imagemagick targets/importers on Windows. Thanks to PXEGeek for tracking down popen calls that were mangling linefeeds. git-svn-id: http://svn.voria.com/code@934 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/modules/mod_dv/trgt_dv.cpp | 2 +- synfig-core/trunk/src/modules/mod_ffmpeg/mptr_ffmpeg.cpp | 2 +- synfig-core/trunk/src/modules/mod_ffmpeg/trgt_ffmpeg.cpp | 2 +- synfig-core/trunk/src/modules/mod_imagemagick/mptr_imagemagick.cpp | 2 +- synfig-core/trunk/src/modules/mod_imagemagick/trgt_imagemagick.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/synfig-core/trunk/src/modules/mod_dv/trgt_dv.cpp b/synfig-core/trunk/src/modules/mod_dv/trgt_dv.cpp index 8fcaabe..720736c 100644 --- a/synfig-core/trunk/src/modules/mod_dv/trgt_dv.cpp +++ b/synfig-core/trunk/src/modules/mod_dv/trgt_dv.cpp @@ -128,7 +128,7 @@ dv_trgt::init() command=strprintf("encodedv - > \"%s\"\n",filename.c_str()); // Open the pipe to encodedv - file=popen(command.c_str(),"w"); + file=popen(command.c_str(),"wb"); if(!file) { 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 116c6da..cd38376 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(),"r"); + file=popen(command.c_str(),"rb"); if(!file) { diff --git a/synfig-core/trunk/src/modules/mod_ffmpeg/trgt_ffmpeg.cpp b/synfig-core/trunk/src/modules/mod_ffmpeg/trgt_ffmpeg.cpp index cf82354..5585878 100644 --- a/synfig-core/trunk/src/modules/mod_ffmpeg/trgt_ffmpeg.cpp +++ b/synfig-core/trunk/src/modules/mod_ffmpeg/trgt_ffmpeg.cpp @@ -128,7 +128,7 @@ ffmpeg_trgt::init() command=strprintf("ffmpeg -f image2pipe -vcodec ppm -an -r %f -i pipe: -loop -hq -title \"%s\" -vcodec mpeg1video -y \"%s\"\n",desc.get_frame_rate(),get_canvas()->get_name().c_str(),filename.c_str()); - file=popen(command.c_str(),"w"); + file=popen(command.c_str(),"wb"); // etl::yield(); 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 390f611..4d8a08c 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(),"r"); + file=popen(command.c_str(),"rb"); if(!file) { diff --git a/synfig-core/trunk/src/modules/mod_imagemagick/trgt_imagemagick.cpp b/synfig-core/trunk/src/modules/mod_imagemagick/trgt_imagemagick.cpp index 123640b..7478001 100644 --- a/synfig-core/trunk/src/modules/mod_imagemagick/trgt_imagemagick.cpp +++ b/synfig-core/trunk/src/modules/mod_imagemagick/trgt_imagemagick.cpp @@ -125,7 +125,7 @@ imagemagick_trgt::start_frame(synfig::ProgressCallback *cb) else command=strprintf("convert -depth 8 -size %dx%d rgb:-[0] -density %dx%d \"%s\"\n",desc.get_w(),desc.get_h(),round_to_int(desc.get_x_res()/39.3700787402),round_to_int(desc.get_y_res()/39.3700787402),filename.c_str()); - file=popen(command.c_str(),"w"); + file=popen(command.c_str(),"wb"); if(!file) { -- 2.7.4