rework intl strategy, titler upgrades, fonts fixes, igor ru.po
[goodguy/history.git] / cinelerra-5.1 / cinelerra / ffmpeg.C
index 60a17ed49e6cb584e8a260b2ac12c8b320542593..4239bc5d203329bb8a852fb24445871d78b85449 100644 (file)
@@ -1837,7 +1837,7 @@ int FFMPEG::open_encoder(const char *type, const char *spec)
                                sprintf(arg, "%d", asset->ff_video_bitrate);
                                av_dict_set(&sopts, "b", arg, 0);
                        }
-                       else if( asset->ff_video_quality > 0 ) {
+                       else if( asset->ff_video_quality >= 0 ) {
                                ctx->global_quality = asset->ff_video_quality * FF_QP2LAMBDA;
                                ctx->qmin    = ctx->qmax =  asset->ff_video_quality;
                                ctx->mb_lmin = ctx->qmin * FF_QP2LAMBDA;
@@ -1884,6 +1884,9 @@ int FFMPEG::open_encoder(const char *type, const char *spec)
                if( fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER )
                        st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
 
+               av_dict_set(&sopts, "cin_bitrate", 0, 0);
+               av_dict_set(&sopts, "cin_quality", 0, 0);
+
                ret = avcodec_open2(st->codec, codec, &sopts);
                if( ret < 0 ) {
                        ff_err(ret,"FFMPEG::open_encoder");
@@ -2051,7 +2054,8 @@ int FFMPEG::encode_activate()
                                for( int i=sizeof(lcode)/sizeof(lcode[0]); --i>=0 && !ep; )
                                        if( !strncmp(lcode[i].lc,lp,2) ) ep = lcode[i].lng;
                        }
-                       char lang[4];
+                       if( !ep ) ep = "und";
+                       char lang[5];
                        strncpy(lang,ep,3);  lang[3] = 0;
                        AVStream *st = ffaudio[0]->st;
                        av_dict_set(&st->metadata,"language",lang,0);