From 002401fa7cdcc0ca2ede03abeb85582e89276c0d Mon Sep 17 00:00:00 2001 From: pabs Date: Sun, 11 Mar 2007 05:55:33 +0000 Subject: [PATCH] Partially fix mod_libavcodec: it can now render files without crashing. However there be gremlins in that thar code, for example if initialisation fails, synfig will return an error message as it should and then crash on program shutdown! Also, encoding audio with the video is not supported at all, since the code that does that is disabled with comment and #ifdefs. git-svn-id: http://svn.voria.com/code@287 1f10aa63-cdf2-0310-b900-c93c546f37ac --- .../trunk/src/modules/mod_libavcodec/trgt_av.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp b/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp index da8cfc6..5a22493 100644 --- a/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp +++ b/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp @@ -584,21 +584,11 @@ public: //set output parameters: required in ALL cases - AVFormatParameters fmtparam,*ap = &fmtparam; - memset(ap, 0, sizeof(*ap)); - // FIXME: Port next two lines to recent libavcodec versions - //ap->frame_rate = vInfo.fps; - //ap->frame_rate_base = 1; - ap->width = vInfo.w; - ap->height = vInfo.h; - //ap->pix_fmt = frame_pix_fmt; + video_st->codec->time_base= (AVRational){1,vInfo.fps}; + video_st->codec->width = vInfo.w; + video_st->codec->height = vInfo.h; + video_st->codec->pix_fmt = PIX_FMT_YUV420P; - if(av_set_parameters(formatc, ap) < 0) - { - synfig::warning("Invalid output formatting parameters"); - return 0; - } - //dump the formatting information as the file header dump_format(formatc, 0, filename, 1); -- 2.7.4