bunch of small fixes, add msg.txt to about prefs
[goodguy/history.git] / cinelerra-5.0 / cinelerra / formattools.C
index a8f3f6bf85da74f0e2b7d4c76568d728d980e37d..bdc96d4ea4496bbdcecd728a5d326581f7b46b87 100644 (file)
@@ -851,18 +851,21 @@ FormatFFMPEG::~FormatFFMPEG()
 }
 
 int FormatFFMPEG::load_defaults(const char *path, const char *type,
-               char *codec, char *codec_options, int len)
+                char *codec, char *codec_options, int len)
 {
        char default_file[BCTEXTLEN];
-       FFMPEG::set_option_path(default_file, "%s/%s", path, type);
+       FFMPEG::set_option_path(default_file, "%s/%s.dfl", path, type);
        FILE *fp = fopen(default_file,"r");
        if( !fp ) return 1;
-       char default_codec[BCSTRLEN];
-       fgets(default_codec, sizeof(default_codec), fp);
-       fclose(fp);
-       char *cp=codec, *dp=default_codec;
-       while( *dp && *dp!='\n' ) *cp++ = *dp++;
+       fgets(codec, BCSTRLEN, fp);
+       char *cp = codec;
+       while( *cp && *cp!='\n' ) ++cp;
        *cp = 0;
+       while( len > 0 && fgets(codec_options, len, fp) ) {
+               int n = strlen(codec_options);
+               codec_options += n;  len -= n;
+       }
+       fclose(fp);
        FFMPEG::set_option_path(default_file, "%s/%s", path, codec);
        return FFMPEG::load_options(default_file, codec_options, len);
 }