From: Good Guy Date: Sat, 28 Jul 2018 23:24:46 +0000 (-0600) Subject: libzmpeg3 layer3 tweak, listbox selection fix, vicon emtpy video fixes X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=7cec2a82e63b4cbd8ce58fd98bd66eb4e7f2e826;p=goodguy%2Fhistory.git libzmpeg3 layer3 tweak, listbox selection fix, vicon emtpy video fixes --- diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index e7f8e7be..505f32f1 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -134,6 +134,15 @@ VFrame *AssetVIcon::frame() temp->draw_line(x,0, x,vh); return temp; } + int ww = picon->gui->vicon_thread->view_w; + int hh = picon->gui->vicon_thread->view_h; + if( !asset->video_data ) { + if( !temp ) { + temp = new VFrame(0, -1, ww, hh, BC_RGB888, -1); + temp->clear_frame(); + } + return temp; + } if( seq_no >= images.size() ) { MWindow *mwindow = picon->mwindow; File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1); @@ -143,8 +152,6 @@ VFrame *AssetVIcon::frame() } if( !temp ) temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1); - int ww = picon->gui->vicon_thread->view_w; - int hh = picon->gui->vicon_thread->view_h; while( seq_no >= images.size() ) { file->set_layer(0); int64_t pos = images.size() / picon->gui->vicon_thread->refresh_rate * frame_rate; diff --git a/cinelerra-5.1/guicast/bclistbox.C b/cinelerra-5.1/guicast/bclistbox.C index b10cdf08..320e98bc 100644 --- a/cinelerra-5.1/guicast/bclistbox.C +++ b/cinelerra-5.1/guicast/bclistbox.C @@ -2093,8 +2093,7 @@ int BC_ListBox::get_cursor_item(ArrayList *data, int cursor_x, return j; } } - if( display_format == LISTBOX_ICONS ) return -1; - } // fall through + return -1; } case LISTBOX_TEXT: if( !gui ) break; // Text is treed diff --git a/cinelerra-5.1/guicast/vicon.C b/cinelerra-5.1/guicast/vicon.C index 1f80bc47..d7262650 100644 --- a/cinelerra-5.1/guicast/vicon.C +++ b/cinelerra-5.1/guicast/vicon.C @@ -43,6 +43,8 @@ add_image(VFrame *frm, int ww, int hh, int vcmdl) void VIcon:: draw_vframe(VIconThread *vt, BC_WindowBase *wdw, int x, int y) { + VFrame *vfrm = frame(); + if( !vfrm ) return; int sx0 = 0, sx1 = sx0 + vt->view_w; int sy0 = 0, sy1 = sy0 + vt->view_h; int dx0 = x, dx1 = dx0 + vw; @@ -54,7 +56,7 @@ draw_vframe(VIconThread *vt, BC_WindowBase *wdw, int x, int y) int sw = sx1 - sx0, sh = sy1 - sy0; int dw = dx1 - dx0, dh = dy1 - dy0; if( dw > 0 && dh > 0 && sw > 0 && sh > 0 ) - wdw->draw_vframe(frame(), dx0,dy0, dw,dh, sx0,sy0, sw,sh); + wdw->draw_vframe(vfrm, dx0,dy0, dw,dh, sx0,sy0, sw,sh); } void VIconThread:: @@ -184,6 +186,7 @@ ViewPopup::~ViewPopup() void ViewPopup::draw_vframe(VFrame *frame) { + if( !frame ) return; BC_WindowBase::draw_vframe(frame, 0,0, get_w(),get_h()); } diff --git a/cinelerra-5.1/libzmpeg3/audio/layer3.C b/cinelerra-5.1/libzmpeg3/audio/layer3.C index 984bb053..b0eb2909 100644 --- a/cinelerra-5.1/libzmpeg3/audio/layer3.C +++ b/cinelerra-5.1/libzmpeg3/audio/layer3.C @@ -791,7 +791,7 @@ do_layer3(uint8_t *zframe, int zframe_size, float **zoutput, int render) //zmsg(" 7\n"); /* Step back */ if( sideinfo.main_data_begin >= 512 ) return output_offset; - if( sideinfo.main_data_begin ) { +// if( sideinfo.main_data_begin ) { /* apparently, zero is legal */ prev_len = sideinfo.main_data_begin; uint8_t *prev = prev_bsbuf + prev_framesize - prev_len; //zmsgs(" 7 %ld %d %ld\n", ssize, sideinfo.main_data_begin, prev_framesize); @@ -799,7 +799,7 @@ do_layer3(uint8_t *zframe, int zframe_size, float **zoutput, int render) memcpy(ptr, prev, prev_len); past_framesize += prev_framesize; } - } +//} if( ptr && past_framesize >= prev_len ) { stream->use_ptr(ptr); for( gr=0; gr