From 572fe9640f0b88c7682958f532db49d524f6719c Mon Sep 17 00:00:00 2001 From: Niels Elburg Date: Wed, 24 Feb 2010 18:54:10 +0000 Subject: [PATCH] Dont tell veejay to set framerate at startup, take-out usleep in previewthread, disconnect ui when 2/10 fail. git-svn-id: svn://code.dyne.org/veejay/trunk@1396 eb8d1916-c9e9-0310-b8de-cf0c9472ead5 --- veejay-current/veejay-client/src/callback.c | 9 ++++++--- veejay-current/veejay-client/src/sequence.c | 13 +++++++++---- veejay-current/veejay-client/src/vj-api.c | 3 +++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/veejay-current/veejay-client/src/callback.c b/veejay-current/veejay-client/src/callback.c index a64e3d36..a75afe07 100644 --- a/veejay-current/veejay-client/src/callback.c +++ b/veejay-current/veejay-client/src/callback.c @@ -2002,9 +2002,12 @@ void on_frameratenormal_clicked( GtkWidget *w, gpointer data ) void on_framerate_value_changed( GtkWidget *w, gpointer data ) { - gdouble slider_val = GTK_ADJUSTMENT(GTK_RANGE(w)->adjustment)->value; - int value = (int)(100.0 * slider_val); - multi_vims( VIMS_FRAMERATE, "%d", value ); + if(info->status_lock) + return; + + gdouble slider_val = GTK_ADJUSTMENT(GTK_RANGE(w)->adjustment)->value; + int value = (int)(100.0 * slider_val); + multi_vims( VIMS_FRAMERATE, "%d", value ); vj_midi_learning_vims_simple( info->midi, "framerate", VIMS_FRAMERATE ); } diff --git a/veejay-current/veejay-client/src/sequence.c b/veejay-current/veejay-client/src/sequence.c index e3614ed2..3083695f 100644 --- a/veejay-current/veejay-client/src/sequence.c +++ b/veejay-current/veejay-client/src/sequence.c @@ -455,7 +455,7 @@ static int veejay_get_image_data(veejay_preview_t *vp, veejay_track_t *v ) res = recvvims( v, 7, &bw, v->data_buffer ); if( res <= 0 || bw <= 0 ) { - veejay_msg(VEEJAY_MSG_WARNING, "Can't get a preview image"); + veejay_msg(VEEJAY_MSG_WARNING, "Can't get a preview image! Only got %d bytes", bw); v->have_frame = 0; return 0; } @@ -540,19 +540,24 @@ static int gvr_preview_process_status( veejay_preview_t *vp, veejay_track_t *v ) return 0; } -static int fail_connection = 0; +static int fail_connection = 0; +static int continue_anyway = 0; static int gvr_preview_process_image( veejay_preview_t *vp, veejay_track_t *v ) { if( veejay_get_image_data( vp, v ) == 0 ) { //@ settle - usleep(200000); fail_connection ++; if( fail_connection > 2 ) { - fail_connection = 0; + fail_connection = 0; //@ fail 2 out of 10 images and we break connection return 0; } return 1; + } else { + continue_anyway = (continue_anyway + 1) % 10; + if(continue_anyway == 0) + fail_connection = 0; } + return 1; } diff --git a/veejay-current/veejay-client/src/vj-api.c b/veejay-current/veejay-client/src/vj-api.c index bde5d6dd..da6831d4 100644 --- a/veejay-current/veejay-client/src/vj-api.c +++ b/veejay-current/veejay-client/src/vj-api.c @@ -7101,12 +7101,14 @@ int vj_gui_reconnect(char *hostname,char *group_name, int port_num) return 0; } + vj_msg(VEEJAY_MSG_INFO, "New connection with Veejay running on %s port %d", (group_name == NULL ? hostname : group_name), port_num ); veejay_msg(VEEJAY_MSG_INFO, "Connection established with %s:%d (Track 0)",hostname,port_num); load_editlist_info(); + info->status_lock = 1; update_slider_value( "framerate", info->el.fps, 0 ); @@ -7129,6 +7131,7 @@ int vj_gui_reconnect(char *hostname,char *group_name, int port_num) update_label_str( "label_hostnamex", (hostname == NULL ? group_name: hostname ) ); update_label_i( "label_portx",port_num,0); + info->status_lock = 0; multitrack_configure( info->mt, info->el.fps, info->el.width, info->el.height, &preview_box_w_, &preview_box_h_ );