fix eof getting per unit
authorMaksym Veremeyenko <verem@m1stereo.tv>
Sun, 12 Jun 2011 14:08:22 +0000 (17:08 +0300)
committerMaksym Veremeyenko <verem@m1stereo.tv>
Sun, 12 Jun 2011 14:08:22 +0000 (17:08 +0300)
src/dv1394app.c
src/dv1394app.h
src/page_status.c

index c462b50..6d0487b 100644 (file)
@@ -244,12 +244,12 @@ static gboolean on_transport_pressed( GtkWidget *button, gpointer data )
                
                case 11:
                        mvcp_unit_set( dv, unit, "eof", "loop");
-                       this->eof = 0;
+                       this->eof[this->selected_unit] = 0;
                        break;
 
                case 12:
                        mvcp_unit_set( dv, unit, "eof", "pause");
-                       this->eof = 0;
+                       this->eof[this->selected_unit] = 0;
                        break;
 
                default:
@@ -316,8 +316,10 @@ void dv1394app_show_status( dv1394app this, mvcp_status status )
                gtk_signal_emit_by_name( GTK_OBJECT(trim_adj[TRIM_ADJ_POS]), "value_changed" );
        }
 
-       gtk_widget_set_sensitive( lookup_widget( dv1394app_get_widget( this ), "transport_11" ), this->eof == 'p' );
-       gtk_widget_set_sensitive( lookup_widget( dv1394app_get_widget( this ), "transport_12" ), this->eof == 'l' );
+       gtk_widget_set_sensitive( lookup_widget( dv1394app_get_widget( this ), "transport_11" ),
+               this->eof[this->selected_unit] == 'p' );
+       gtk_widget_set_sensitive( lookup_widget( dv1394app_get_widget( this ), "transport_12" ),
+               this->eof[this->selected_unit] == 'l' );
 }
 
 static gboolean trim_pressed( GtkWidget *button, GdkEventButton *event, gpointer user_data )
index ae411c5..4243601 100644 (file)
@@ -48,7 +48,7 @@ typedef struct
        int trim_in;
        int trim_out;
        int guard;
-       int eof;
+       int eof[16];
 }
 *dv1394app, dv1394app_t;
 
index 1047ec6..295217d 100644 (file)
@@ -211,20 +211,22 @@ static void *status_thread( void *arg )
        
        while ( !this->terminated )
        {
+               char buf[32];
+
+               if ( !this->app->eof[this->app->selected_unit] &&
+                       mvcp_unit_get( this->app->command, this->app->selected_unit,
+                       "eof", buf, sizeof(buf) ) != -1)
+                       this->app->eof[this->app->selected_unit] = buf[0];
+
                if ( mvcp_notifier_wait( notifier, &status ) != -1 )
                {
-                       char buf[32];
-
                        if ( status.status == unit_disconnected )
                        {
-                               this->app->eof = 0;
+                               this->app->eof[this->app->selected_unit] = 0;
                                break;
                        }
                        if ( show_status( this, &status ) )
                                show_units( this, TRUE );
-                       if ( !this->app->eof && mvcp_unit_get( this->app->command, this->app->selected_unit,
-                               "eof", buf, sizeof(buf) ) != -1)
-                                       this->app->eof = buf[0];
                }
        }