From: Good Guy Date: Sun, 5 Feb 2017 00:02:34 +0000 (-0700) Subject: lock trace bug, missed optimize in dvd_create, cin_quality=-1, motion plugin gui... X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=dafc18d66d48cd981a012d2e73a3b3db5351c538;p=goodguy%2Fhistory.git lock trace bug, missed optimize in dvd_create, cin_quality=-1, motion plugin gui errs --- diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C index 155f17fb..9fbee552 100644 --- a/cinelerra-5.1/cinelerra/dvdcreate.C +++ b/cinelerra-5.1/cinelerra/dvdcreate.C @@ -407,6 +407,7 @@ void CreateDVD_Thread::handle_close_event(int result) edit->startproject, edit->length, PLUGIN_STANDALONE, 0, &keyframe, 0); } + vtrk->optimize(); } } @@ -898,6 +899,7 @@ insert_video_plugin(const char *title, KeyFrame *default_keyframe) edit->startproject, edit->length, PLUGIN_STANDALONE, 0, default_keyframe, 0); } + vtrk->optimize(); } return 0; } diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C index e99732b3..6c360da3 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.C +++ b/cinelerra-5.1/cinelerra/fileffmpeg.C @@ -59,10 +59,18 @@ void FFMpegConfigNum::create_objects() BC_TumbleTextBox::create_objects(); } -int FFMpegConfigNum::update_text(const char *text) +int FFMpegConfigNum::update_param(const char *param, const char *opts) { - BC_TumbleTextBox::update(text); - return handle_event(); + char value[BCTEXTLEN]; + if( !FileFFMPEG::get_ff_option(param, opts, value) ) { + if( (*output = atol(value)) < 0 ) { + disable(1); + return 0; + } + BC_TumbleTextBox::update(value); + } + enable(); + return 1; } int FFMpegConfigNum::handle_event() @@ -464,9 +472,7 @@ void FFMPEGConfigAudio::create_objects() add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); - char value[BCTEXTLEN]; - if( !FileFFMPEG::get_ff_option("cin_bitrate", asset->ff_audio_options, value) ) - bitrate->update_text(value); + bitrate->update_param("cin_bitrate", asset->ff_audio_options); show_window(1); bitrate->handle_event(); @@ -504,9 +510,7 @@ int FFMPEGConfigAudioPopup::handle_event() popup->audio_options->update(asset->ff_audio_options); popup->audio_options->set_text_row(0); - char value[BCTEXTLEN]; - if( !FileFFMPEG::get_ff_option("cin_bitrate", asset->ff_audio_options, value) ) - popup->bitrate->update_text(value); + popup->bitrate->update_param("cin_bitrate", asset->ff_audio_options); return 1; } @@ -621,11 +625,8 @@ void FFMPEGConfigVideo::create_objects() add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); - char value[BCTEXTLEN]; - if( !FileFFMPEG::get_ff_option("cin_quality", asset->ff_video_options, value) ) - quality->update_text(value); - if( !FileFFMPEG::get_ff_option("cin_bitrate", asset->ff_video_options, value) ) - bitrate->update_text(value); + bitrate->update_param("cin_bitrate", asset->ff_video_options); + quality->update_param("cin_quality", asset->ff_video_options); show_window(1); if( asset->ff_video_bitrate ) @@ -666,12 +667,8 @@ int FFMPEGConfigVideoPopup::handle_event() popup->video_options->update(asset->ff_video_options); popup->video_options->set_text_row(0); - char value[BCTEXTLEN]; - if( !FileFFMPEG::get_ff_option("cin_quality", asset->ff_video_options, value) ) { - popup->quality->update_text(value); - } - if( !FileFFMPEG::get_ff_option("cin_bitrate", asset->ff_video_options, value) ) - popup->bitrate->update_text(value); + popup->bitrate->update_param("cin_bitrate", asset->ff_video_options); + popup->quality->update_param("cin_quality", asset->ff_video_options); return 1; } diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.h b/cinelerra-5.1/cinelerra/fileffmpeg.h index 63de93c7..edbe437f 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.h +++ b/cinelerra-5.1/cinelerra/fileffmpeg.h @@ -62,7 +62,7 @@ public: ~FFMpegConfigNum(); void create_objects(); - int update_text(const char *text); + int update_param(const char *param, const char *opts); int handle_event(); int *output; BC_Window *window; diff --git a/cinelerra-5.1/cinelerra/mbuttons.C b/cinelerra-5.1/cinelerra/mbuttons.C index b5d567ac..a91c0cbc 100644 --- a/cinelerra-5.1/cinelerra/mbuttons.C +++ b/cinelerra-5.1/cinelerra/mbuttons.C @@ -102,20 +102,6 @@ void MButtons::update() } - - - - - - - - - - - - - - MainTransport::MainTransport(MWindow *mwindow, MButtons *mbuttons, int x, int y) : PlayTransport(mwindow, mbuttons, x, y) { @@ -139,28 +125,9 @@ void MainTransport::goto_end() } MainEditing::MainEditing(MWindow *mwindow, MButtons *mbuttons, int x, int y) - : EditPanel(mwindow, - mbuttons, - x, - y, - mwindow->edl->session->editing_mode, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, // locklabels - 1, - 1, - 0, - 1, - 1, - mwindow->has_commercials()) + : EditPanel(mwindow, mbuttons, x, y, mwindow->edl->session->editing_mode, + 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, // locklabels + 1, 1, 0, 1, 1, mwindow->has_commercials()) { this->mwindow = mwindow; this->mbuttons = mbuttons; diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 7c3b8575..9724470d 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -405,10 +405,10 @@ int MWindowGUI::resize_event(int w, int h) int x = w - MainShBtns::calculate_w(0); mainmenu->resize_event(x, mainmenu->get_h()); mainshbtns->reposition_window(x, -1); + ffmpeg_toggle->reposition_window(menu_w(), menu_h()+2); mwindow->theme->get_mwindow_sizes(this, w, h); mwindow->theme->draw_mwindow_bg(this); mbuttons->resize_event(); - ffmpeg_toggle->reposition_window(menu_w(), menu_h()+2); statusbar->resize_event(); zoombar->resize_event(); @@ -535,6 +535,7 @@ int MWindowGUI::resize_event(int w, int h) mwindow->theme->mzoom_y + 1 - mwindow->theme->get_image_set("pane")[0]->get_h()); resource_thread->start_draw(); + flash(1); return 0; } diff --git a/cinelerra-5.1/cinelerra/zoombar.C b/cinelerra-5.1/cinelerra/zoombar.C index 8c9c8a49..8dca9e10 100644 --- a/cinelerra-5.1/cinelerra/zoombar.C +++ b/cinelerra-5.1/cinelerra/zoombar.C @@ -129,6 +129,7 @@ void ZoomBar::resize_event() { reposition_window(mwindow->theme->mzoom_x, mwindow->theme->mzoom_y, mwindow->theme->mzoom_w, mwindow->theme->mzoom_h); + draw_top_background(get_parent(), 0, 0, get_w(), get_h()); } void ZoomBar::redraw_time_dependancies() diff --git a/cinelerra-5.1/ffmpeg/video/h265-12bit.mp4 b/cinelerra-5.1/ffmpeg/video/h265-12bit.mp4 index 3d42dbb8..93c8965c 100644 --- a/cinelerra-5.1/ffmpeg/video/h265-12bit.mp4 +++ b/cinelerra-5.1/ffmpeg/video/h265-12bit.mp4 @@ -6,4 +6,4 @@ color_primaries=bt2020 color_trc=bt2020_12bit pixel_format=yuv422p12 x265-params=output-depth=12 - +cin_quality=-1 diff --git a/cinelerra-5.1/ffmpeg/video/h265-hi.mp4 b/cinelerra-5.1/ffmpeg/video/h265-hi.mp4 index 8e2a09d6..d73b1a5e 100644 --- a/cinelerra-5.1/ffmpeg/video/h265-hi.mp4 +++ b/cinelerra-5.1/ffmpeg/video/h265-hi.mp4 @@ -1,2 +1,3 @@ mp4 libx265 crf=5 +cin_quality=-1 diff --git a/cinelerra-5.1/ffmpeg/video/h265-lo.mp4 b/cinelerra-5.1/ffmpeg/video/h265-lo.mp4 index 1bbf933d..c3d54288 100644 --- a/cinelerra-5.1/ffmpeg/video/h265-lo.mp4 +++ b/cinelerra-5.1/ffmpeg/video/h265-lo.mp4 @@ -1,3 +1,4 @@ mp4 libx265 # lossy but faster crf=25 +cin_quality=-1 diff --git a/cinelerra-5.1/ffmpeg/video/h265-med.mp4 b/cinelerra-5.1/ffmpeg/video/h265-med.mp4 index b8b93753..0408dcb1 100644 --- a/cinelerra-5.1/ffmpeg/video/h265-med.mp4 +++ b/cinelerra-5.1/ffmpeg/video/h265-med.mp4 @@ -1,3 +1,4 @@ mp4 libx265 # visually lossless crf=18 +cin_quality=-1 diff --git a/cinelerra-5.1/ffmpeg/video/h265.mp4 b/cinelerra-5.1/ffmpeg/video/h265.mp4 index d045e233..8174ea34 100644 --- a/cinelerra-5.1/ffmpeg/video/h265.mp4 +++ b/cinelerra-5.1/ffmpeg/video/h265.mp4 @@ -1 +1,2 @@ mp4 libx265 +cin_quality=-1 diff --git a/cinelerra-5.1/guicast/bctextbox.C b/cinelerra-5.1/guicast/bctextbox.C index 52aa85d3..cac049a2 100644 --- a/cinelerra-5.1/guicast/bctextbox.C +++ b/cinelerra-5.1/guicast/bctextbox.C @@ -990,6 +990,7 @@ int BC_TextBox::deactivate() { if( active ) { active = 0; + text_selected = word_selected = line_selected = 0; top_level->set_active_subwindow(0); top_level->unset_repeat(top_level->get_resources()->blink_rate); } @@ -2781,17 +2782,23 @@ int BC_TumbleTextBox::get_h() return textbox->get_h(); } -void BC_TumbleTextBox::disable() +void BC_TumbleTextBox::disable(int hide_text) { + if( hide_text && !textbox->is_hidden() ) + textbox->hide_window(0); + if( !tumbler->is_hidden() ) + tumbler->hide_window(0); if( !get_enabled() ) return; - tumbler->hide_window(0); return textbox->disable(); } void BC_TumbleTextBox::enable() { + if( textbox->is_hidden() ) + textbox->show_window(0); + if( tumbler->is_hidden() ) + tumbler->show_window(0); if( get_enabled() ) return; - tumbler->show_window(0); return textbox->enable(); } diff --git a/cinelerra-5.1/guicast/bctextbox.h b/cinelerra-5.1/guicast/bctextbox.h index f7d38094..7b07ded1 100644 --- a/cinelerra-5.1/guicast/bctextbox.h +++ b/cinelerra-5.1/guicast/bctextbox.h @@ -394,7 +394,7 @@ public: int get_y(); int get_w(); int get_h(); - void disable(); + void disable(int hide_text=0); void enable(); int get_enabled(); void reposition_window(int x, int y); diff --git a/cinelerra-5.1/guicast/bctrace.C b/cinelerra-5.1/guicast/bctrace.C index 47638fe9..b15cfea1 100644 --- a/cinelerra-5.1/guicast/bctrace.C +++ b/cinelerra-5.1/guicast/bctrace.C @@ -114,12 +114,12 @@ int BC_Trace::set_lock(const char *title, const char *loc, trace_info *info) last_lock_title = title; last_lock_location = loc; lock_item *it; - if( lock_table.size >= TOTAL_LOCKS ) { + if( (it=(lock_item*)lock_free.first) != 0 ) + lock_free.remove_pointer(it); + else if( lock_table.size >= TOTAL_LOCKS ) { it = (lock_item*)lock_table.first; lock_table.remove_pointer(it); } - else if( (it=(lock_item*)lock_free.first) != 0 ) - lock_free.remove_pointer(it); else it = new lock_item(); it->set(info, title, loc); diff --git a/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C b/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C index ffe0b911..eeadec0c 100644 --- a/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C +++ b/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C @@ -150,6 +150,9 @@ void MotionCVWindow::create_objects() new BC_Title(x1=x2, y1=y, _("Frame number:"))); add_subwindow(track_frame_number = new TrackFrameNumber(plugin, this, x1 += title->get_w(), y1)); + if( plugin->config.mode3 != MotionCVConfig::TRACK_SINGLE ) + track_frame_number->disable(); + add_subwindow(addtrackedframeoffset = new AddTrackedFrameOffset(plugin, this, x1=x2, y1+=track_frame_number->get_h())); int pef = client->server->mwindow->edl->session->video_every_frame; @@ -484,8 +487,6 @@ TrackFrameNumber::TrackFrameNumber(MotionCVMain *plugin, { this->plugin = plugin; this->gui = gui; - if( plugin->config.mode3 != MotionCVConfig::TRACK_SINGLE ) - disable(); } int TrackFrameNumber::handle_event() diff --git a/cinelerra-5.1/plugins/motion-hv/motionwindow-hv.C b/cinelerra-5.1/plugins/motion-hv/motionwindow-hv.C index ad536ba5..d61080b9 100644 --- a/cinelerra-5.1/plugins/motion-hv/motionwindow-hv.C +++ b/cinelerra-5.1/plugins/motion-hv/motionwindow-hv.C @@ -209,6 +209,8 @@ void MotionHVWindow::create_objects() this, x + track_single->get_w() + title->get_w() + 20, y)); + if(plugin->config.tracking_object != MotionHVScan::TRACK_SINGLE) + track_frame_number->disable(); y += 20; add_subwindow(track_previous = new TrackPreviousFrame(plugin, @@ -779,7 +781,6 @@ TrackFrameNumber::TrackFrameNumber(MotionHVMain *plugin, { this->plugin = plugin; this->gui = gui; - if(plugin->config.tracking_object != MotionHVScan::TRACK_SINGLE) disable(); } int TrackFrameNumber::handle_event() diff --git a/cinelerra-5.1/plugins/motion/motionwindow.C b/cinelerra-5.1/plugins/motion/motionwindow.C index 8f3a244a..b8930e20 100644 --- a/cinelerra-5.1/plugins/motion/motionwindow.C +++ b/cinelerra-5.1/plugins/motion/motionwindow.C @@ -172,6 +172,9 @@ void MotionWindow::create_objects() new BC_Title(x1=x2, y1, _("Frame number:"))); add_subwindow(track_frame_number = new TrackFrameNumber(plugin, this, x1 += title->get_w(), y1)); + if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE) + track_frame_number->disable(); + add_subwindow(addtrackedframeoffset = new AddTrackedFrameOffset(plugin, this, x1=x2, y1+=track_frame_number->get_h())); int pef = client->server->mwindow->edl->session->video_every_frame; @@ -605,7 +608,6 @@ TrackFrameNumber::TrackFrameNumber(MotionMain *plugin, { this->plugin = plugin; this->gui = gui; - if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE) disable(); } int TrackFrameNumber::handle_event() diff --git a/cinelerra-5.1/plugins/motion2point/motionwindow.C b/cinelerra-5.1/plugins/motion2point/motionwindow.C index f10a7f39..8b330724 100644 --- a/cinelerra-5.1/plugins/motion2point/motionwindow.C +++ b/cinelerra-5.1/plugins/motion2point/motionwindow.C @@ -200,6 +200,8 @@ void MotionWindow::create_objects() this, x + track_single->get_w() + title->get_w() + 20, y)); + if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE) + track_frame_number->disable(); y += 20; add_subwindow(track_previous = new TrackPreviousFrame(plugin, @@ -614,7 +616,6 @@ TrackFrameNumber::TrackFrameNumber(MotionMain2 *plugin, { this->plugin = plugin; this->gui = gui; - if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE) disable(); } int TrackFrameNumber::handle_event()