]> git.sesse.net Git - vlc/commitdiff
Removed define in favor of (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU) for detecti...
authorJean-Paul Saman <jpsaman@videolan.org>
Sat, 4 Jan 2003 13:30:02 +0000 (13:30 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Sat, 4 Jan 2003 13:30:02 +0000 (13:30 +0000)
configure.ac.in
modules/gui/familiar/familiar.c
modules/gui/familiar/familiar.h

index 2c701d59b9a9eeae7de9fccc045e22bff6d2450e..9cfb42a6462bb7d9e1a5ef159bc1b56ffaa16a88 100644 (file)
@@ -855,10 +855,6 @@ AC_ARG_WITH(tuning,
 if test "x${with_tuning}" != "x"; then
     if test "x${target_cpu}" = "xpowerpc"; then
         CFLAGS_TUNING="-mtune=${with_tuning}"
-    elif test "x${target_cpu}" = "xstrongarm1100"; then
-        CFLAGS_TUNING="-mtune=${with_tuning}"
-           AC_DEFINE(HAVE_STRONGARM, 1, Define if have a strongarm cpu, because then we should not do FPU calculations
- due to lack of FPU hardware support. Otherwise it would be *slow*)
     else
         CFLAGS_TUNING="-mcpu=${with_tuning}"
     fi
index 09c0fd841fb935b3d25723c2d231dbc51eca3ea1..174dd86b0f55d6f0feb1c443263dd57427738f4b 100644 (file)
@@ -2,7 +2,7 @@
  * familiar.c : familiar plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: familiar.c,v 1.23 2003/01/04 00:21:00 jpsaman Exp $
+ * $Id: familiar.c,v 1.24 2003/01/04 13:30:02 jpsaman Exp $
  *
  * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
  *
@@ -197,6 +197,7 @@ static void Run( intf_thread_t *p_intf )
     gtk_signal_connect ( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed",
                          GTK_SIGNAL_FUNC( E_(GtkDisplayDate) ), NULL );
     p_intf->p_sys->f_adj_oldvalue = 0;
+    p_intf->p_sys->i_adj_oldvalue = 0;
 #undef P_SLIDER
 
     p_intf->p_sys->p_clist = GTK_CLIST( gtk_object_get_data(
@@ -323,45 +324,77 @@ static int Manage( intf_thread_t *p_intf )
             }
 
             /* Manage the slider */
-            if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
-            {
-#ifndef HAVE_STRONGARM
-                float newvalue = p_intf->p_sys->p_adj->value;
-#else
-                off_t newvalue = p_intf->p_sys->p_adj->value;
-#endif
+            if (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU)
+                       {       
+                /* Manage the slider for CPU_CAPABILITY_FPU hardware */                                
+                if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
+                {
+                    float newvalue = p_intf->p_sys->p_adj->value;
 
 #define p_area p_input->stream.p_selected_area
-                /* If the user hasn't touched the slider since the last time,
-                 * then the input can safely change it */
-                if( newvalue == p_intf->p_sys->f_adj_oldvalue )
-                {
-                    /* Update the value */
-                    p_intf->p_sys->p_adj->value =
-                    p_intf->p_sys->f_adj_oldvalue =
-#ifndef HAVE_STRONGARM
-                        ( 100. * p_area->i_tell ) / p_area->i_size;
-#else
-                                               ( 100 * p_area->i_tell ) / p_area->i_size;                                              
-#endif
-                    gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
-                                             "value_changed" );
+                    /* If the user hasn't touched the slider since the last time,
+                     * then the input can safely change it */
+                    if( newvalue == p_intf->p_sys->f_adj_oldvalue )
+                    {
+                        /* Update the value */
+                        p_intf->p_sys->p_adj->value =
+                        p_intf->p_sys->f_adj_oldvalue =
+                            ( 100. * p_area->i_tell ) / p_area->i_size;
+                        gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
+                                                 "value_changed" );
+                    }
+                    /* Otherwise, send message to the input if the user has
+                     * finished dragging the slider */
+                    else if( p_intf->p_sys->b_slider_free )
+                    {
+                        off_t i_seek = ( newvalue * p_area->i_size ) / 100;
+
+                        /* release the lock to be able to seek */
+                        vlc_mutex_unlock( &p_input->stream.stream_lock );
+                        input_Seek( p_input, i_seek, INPUT_SEEK_SET );
+                        vlc_mutex_lock( &p_input->stream.stream_lock );
+
+                        /* Update the old value */
+                        p_intf->p_sys->f_adj_oldvalue = newvalue;
+                    }
+#undef p_area
                 }
-                /* Otherwise, send message to the input if the user has
-                 * finished dragging the slider */
-                else if( p_intf->p_sys->b_slider_free )
+                       }
+                       else
+                       {
+                /* Manage the slider without CPU_CAPABILITY_FPU hardware */                            
+                if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
                 {
-                    off_t i_seek = ( newvalue * p_area->i_size ) / 100;
-
-                    /* release the lock to be able to seek */
-                    vlc_mutex_unlock( &p_input->stream.stream_lock );
-                    input_Seek( p_input, i_seek, INPUT_SEEK_SET );
-                    vlc_mutex_lock( &p_input->stream.stream_lock );
+                    off_t newvalue = p_intf->p_sys->p_adj->value;
 
-                    /* Update the old value */
-                    p_intf->p_sys->f_adj_oldvalue = newvalue;
-                }
+#define p_area p_input->stream.p_selected_area
+                    /* If the user hasn't touched the slider since the last time,
+                     * then the input can safely change it */
+                    if( newvalue == p_intf->p_sys->i_adj_oldvalue )
+                    {
+                        /* Update the value */
+                        p_intf->p_sys->p_adj->value =
+                        p_intf->p_sys->i_adj_oldvalue =
+                            ( 100 * p_area->i_tell ) / p_area->i_size;
+                        gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
+                                                 "value_changed" );
+                    }
+                    /* Otherwise, send message to the input if the user has
+                     * finished dragging the slider */
+                    else if( p_intf->p_sys->b_slider_free )
+                    {
+                        off_t i_seek = ( newvalue * p_area->i_size ) / 100;
+
+                        /* release the lock to be able to seek */
+                        vlc_mutex_unlock( &p_input->stream.stream_lock );
+                        input_Seek( p_input, i_seek, INPUT_SEEK_SET );
+                        vlc_mutex_lock( &p_input->stream.stream_lock );
+
+                        /* Update the old value */
+                        p_intf->p_sys->i_adj_oldvalue = newvalue;
+                    }
 #undef p_area
+                }
             }
         }
         vlc_mutex_unlock( &p_input->stream.stream_lock );
@@ -441,7 +474,10 @@ gint E_(GtkModeManage)( intf_thread_t * p_intf )
         /* initialize and show slider for seekable streams */
         if( p_intf->p_sys->p_input->stream.b_seekable )
         {
-            p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue = 0;
+                       if (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU)
+                p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue = 0;
+            else
+                               p_intf->p_sys->p_adj->value = p_intf->p_sys->i_adj_oldvalue = 0;
             gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
                                      "value_changed" );
             gtk_widget_show( GTK_WIDGET( p_slider ) );
index a22ec07089a6c9efc1afe4b9581cb9ca3da1ca93..33783afe91f5709aae09eb3fb7330ced588cc400 100644 (file)
@@ -2,7 +2,7 @@
  * familiar.h: private Gtk+ interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: familiar.h,v 1.11 2003/01/04 00:21:00 jpsaman Exp $
+ * $Id: familiar.h,v 1.12 2003/01/04 13:30:02 jpsaman Exp $
  *
  * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
  *
@@ -40,11 +40,9 @@ struct intf_sys_t
     /* slider */
     GtkLabel *          p_slider_label;
     GtkAdjustment *     p_adj;                   /* slider adjustment object */
-#ifdef HAVE_STRONGARM
-    off_t               f_adj_oldvalue;
-#else
-    float               f_adj_oldvalue;                    /* previous value */
-#endif
+    off_t               i_adj_oldvalue;  /* previous value -no FPU hardware  */
+    float               f_adj_oldvalue;  /* previous value -with FPU hardware*/
+
     /* special actions */
     vlc_bool_t          b_playing;
     vlc_bool_t          b_window_changed;        /* window display toggled ? */