bunch of small fixes, add msg.txt to about prefs
[goodguy/history.git] / cinelerra-5.0 / cinelerra / ffmpeg.C
index 89175ff737032e2bf6790c7676f9f4ec280ebd34..92a9580210d4cf07b6ad23fbc418db1b43e2909d 100644 (file)
@@ -1580,6 +1580,9 @@ int FFMPEG::open_encoder(const char *type, const char *spec)
                }
        }
        if( !ret ) {
+               if( fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER )
+                       st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
+
                ret = avcodec_open2(st->codec, codec, &sopts);
                if( ret < 0 ) {
                        ff_err(ret,"FFMPEG::open_encoder");
@@ -1591,8 +1594,6 @@ int FFMPEG::open_encoder(const char *type, const char *spec)
                        ret = 0;
        }
        if( !ret ) {
-               if( fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER )
-                       st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
                if( fst && bsfilter[0] )
                        fst->add_bsfilter(bsfilter, !bsargs[0] ? 0 : bsargs);
        }