From: pabs Date: Sun, 11 Mar 2007 05:55:33 +0000 (+0000) Subject: Partially fix mod_libavcodec: it can now render files without crashing. However there... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=002401fa7cdcc0ca2ede03abeb85582e89276c0d;p=synfig.git 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 --- 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);