From: pabs Date: Tue, 18 Dec 2007 03:22:09 +0000 (+0000) Subject: Only use the double dash (--) to escape filenames that begin with a dash (-) when... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6a6b760f0534efc146b5e199c3e471f1a8a99d93;p=synfig.git Only use the double dash (--) to escape filenames that begin with a dash (-) when running ffmpeg. This fixes most uses of older versions of ffmpeg that do not support this command-line syntax since most output filenames will not begin with a dash. git-svn-id: http://svn.voria.com/code@1210 1f10aa63-cdf2-0310-b900-c93c546f37ac --- 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 d2e8525..1832ccd 100644 --- a/synfig-core/trunk/src/modules/mod_ffmpeg/trgt_ffmpeg.cpp +++ b/synfig-core/trunk/src/modules/mod_ffmpeg/trgt_ffmpeg.cpp @@ -156,7 +156,10 @@ ffmpeg_trgt::init() } // Close the unneeded pipeout close(p[0]); - execlp("ffmpeg", "ffmpeg", "-f", "image2pipe", "-vcodec", "ppm", "-an", "-r", strprintf("%f", desc.get_frame_rate()).c_str(), "-i", "pipe:", "-loop", "-hq", "-title", get_canvas()->get_name().c_str(), "-vcodec", "mpeg1video", "-y", "--", filename.c_str(), (const char *)NULL); + if( filename.c_str()[0] == '-' ) + execlp("ffmpeg", "ffmpeg", "-f", "image2pipe", "-vcodec", "ppm", "-an", "-r", strprintf("%f", desc.get_frame_rate()).c_str(), "-i", "pipe:", "-loop", "-hq", "-title", get_canvas()->get_name().c_str(), "-vcodec", "mpeg1video", "-y", "--", filename.c_str(), (const char *)NULL); + else + execlp("ffmpeg", "ffmpeg", "-f", "image2pipe", "-vcodec", "ppm", "-an", "-r", strprintf("%f", desc.get_frame_rate()).c_str(), "-i", "pipe:", "-loop", "-hq", "-title", get_canvas()->get_name().c_str(), "-vcodec", "mpeg1video", "-y", filename.c_str(), (const char *)NULL); // We should never reach here unless the exec failed synfig::error(_("Unable to open pipe to ffmpeg")); return false;