X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Ffileffmpeg.C;h=90c1a6ef62071f3fb52bb5d96131f729949f2962;hb=5aad2133f228b736f033d6c48e1629078b858286;hp=fdcf3297e6230916ec19b7810b6c10ca3125e516;hpb=328cb789bec2048b23fc731cf4eae860dbacd2b6;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/cinelerra/fileffmpeg.C b/cinelerra-5.0/cinelerra/fileffmpeg.C index fdcf3297..90c1a6ef 100644 --- a/cinelerra-5.0/cinelerra/fileffmpeg.C +++ b/cinelerra-5.0/cinelerra/fileffmpeg.C @@ -132,28 +132,28 @@ int FileFFMPEG::check_sig(Asset *asset) return ret; } -void FileFFMPEG::get_info(char *path, char *text) +void FileFFMPEG::get_info(char *path, char *text, int len) { char *cp = text; FFMPEG ffmpeg(0); - cp += sprintf(cp, "file path: %s\n", path); + cp += sprintf(cp, _("file path: %s\n"), path); struct stat st; int ret = 0; if( stat(path, &st) < 0 ) { - cp += sprintf(cp, " err: %s\n", strerror(errno)); + cp += sprintf(cp, _(" err: %s\n"), strerror(errno)); ret = 1; } else { - cp += sprintf(cp, " %jd bytes\n", st.st_size); + cp += sprintf(cp, _(" %jd bytes\n"), st.st_size); } if( !ret ) ret = ffmpeg.init_decoder(path); if( !ret ) ret = ffmpeg.open_decoder(); if( !ret ) { - cp += sprintf(cp, "info:\n"); - ffmpeg.info(cp, BCTEXTLEN-(cp-text)); + cp += sprintf(cp, _("info:\n")); + ffmpeg.info(cp, len-(cp-text)); } else - sprintf(cp, "== open failed\n"); + sprintf(cp, _("== open failed\n")); } int FileFFMPEG::get_video_info(int track, int &pid, double &framerate, @@ -187,7 +187,6 @@ int FileFFMPEG::select_video_stream(Asset *asset, int vstream) int FileFFMPEG::select_audio_stream(Asset *asset, int astream) { if( !ff || !asset->audio_data ) return 1; - asset->channels = ff->ff_audio_channels(astream); asset->sample_rate = ff->ff_sample_rate(astream); asset->audio_length = ff->ff_audio_samples(astream); return 0; @@ -319,10 +318,9 @@ int FileFFMPEG::get_best_colormodel(Asset *asset, int driver) } //====== -extern void get_exe_path(char *result); // from main.C FFMPEGConfigAudio::FFMPEGConfigAudio(BC_WindowBase *parent_window, Asset *asset) - : BC_Window(PROGRAM_NAME ": Audio Preset", + : BC_Window(_(PROGRAM_NAME ": Audio Preset"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), 420, 420) @@ -350,16 +348,15 @@ void FFMPEGConfigAudio::create_objects() FileSystem fs; char option_path[BCTEXTLEN]; - FFMPEG::set_option_path(option_path, "/audio"); + FFMPEG::set_option_path(option_path, "audio"); fs.update(option_path); int total_files = fs.total_files(); for(int i = 0; i < total_files; i++) { const char *name = fs.get_entry(i)->get_name(); if( asset->fformat[0] != 0 ) { const char *ext = strrchr(name,'.'); - if( !ext ) ext = name; - else if( !strcmp("opts", ++ext) ) continue; - if( strcmp(asset->fformat, ext) ) continue; + if( !ext ) continue; + if( strcmp(asset->fformat, ++ext) ) continue; } presets.append(new BC_ListBoxItem(name)); } @@ -456,7 +453,7 @@ int FFMPEGConfigAudioToggle::handle_event() //====== FFMPEGConfigVideo::FFMPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset) - : BC_Window(PROGRAM_NAME ": Video Preset", + : BC_Window(_(PROGRAM_NAME ": Video Preset"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), 420, 420) @@ -466,6 +463,7 @@ FFMPEGConfigVideo::FFMPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset) preset_popup = 0; bitrate = 0; + quality = 0; video_options = 0; } @@ -494,9 +492,8 @@ void FFMPEGConfigVideo::create_objects() const char *name = fs.get_entry(i)->get_name(); if( asset->fformat[0] != 0 ) { const char *ext = strrchr(name,'.'); - if( !ext ) ext = name; - else if( !strcmp("opts", ++ext) ) continue; - if( strcmp(asset->fformat, ext) ) continue; + if( !ext ) continue; + if( strcmp(asset->fformat, ++ext) ) continue; } presets.append(new BC_ListBoxItem(name)); }