Commit 15b7c583 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Removed define in favor of (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU) for...

Removed define in favor of (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU) for detection of FPU hardware support.
parent 5c15eb12
...@@ -855,10 +855,6 @@ AC_ARG_WITH(tuning, ...@@ -855,10 +855,6 @@ AC_ARG_WITH(tuning,
if test "x${with_tuning}" != "x"; then if test "x${with_tuning}" != "x"; then
if test "x${target_cpu}" = "xpowerpc"; then if test "x${target_cpu}" = "xpowerpc"; then
CFLAGS_TUNING="-mtune=${with_tuning}" 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 else
CFLAGS_TUNING="-mcpu=${with_tuning}" CFLAGS_TUNING="-mcpu=${with_tuning}"
fi fi
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.c : familiar plugin for vlc * familiar.c : familiar plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * 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> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -197,6 +197,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -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_connect ( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed",
GTK_SIGNAL_FUNC( E_(GtkDisplayDate) ), NULL ); GTK_SIGNAL_FUNC( E_(GtkDisplayDate) ), NULL );
p_intf->p_sys->f_adj_oldvalue = 0; p_intf->p_sys->f_adj_oldvalue = 0;
p_intf->p_sys->i_adj_oldvalue = 0;
#undef P_SLIDER #undef P_SLIDER
p_intf->p_sys->p_clist = GTK_CLIST( gtk_object_get_data( p_intf->p_sys->p_clist = GTK_CLIST( gtk_object_get_data(
...@@ -323,45 +324,77 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -323,45 +324,77 @@ static int Manage( intf_thread_t *p_intf )
} }
/* Manage the slider */ /* Manage the slider */
if( p_input->stream.b_seekable && p_intf->p_sys->b_playing ) if (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU)
{ {
#ifndef HAVE_STRONGARM /* Manage the slider for CPU_CAPABILITY_FPU hardware */
float newvalue = p_intf->p_sys->p_adj->value; if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
#else {
off_t newvalue = p_intf->p_sys->p_adj->value; float newvalue = p_intf->p_sys->p_adj->value;
#endif
#define p_area p_input->stream.p_selected_area #define p_area p_input->stream.p_selected_area
/* If the user hasn't touched the slider since the last time, /* If the user hasn't touched the slider since the last time,
* then the input can safely change it */ * then the input can safely change it */
if( newvalue == p_intf->p_sys->f_adj_oldvalue ) if( newvalue == p_intf->p_sys->f_adj_oldvalue )
{ {
/* Update the value */ /* Update the value */
p_intf->p_sys->p_adj->value = p_intf->p_sys->p_adj->value =
p_intf->p_sys->f_adj_oldvalue = p_intf->p_sys->f_adj_oldvalue =
#ifndef HAVE_STRONGARM ( 100. * p_area->i_tell ) / p_area->i_size;
( 100. * p_area->i_tell ) / p_area->i_size; gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
#else "value_changed" );
( 100 * p_area->i_tell ) / p_area->i_size; }
#endif /* Otherwise, send message to the input if the user has
gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ), * finished dragging the slider */
"value_changed" ); 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
else if( p_intf->p_sys->b_slider_free ) {
/* 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; off_t newvalue = p_intf->p_sys->p_adj->value;
/* 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 */ #define p_area p_input->stream.p_selected_area
p_intf->p_sys->f_adj_oldvalue = newvalue; /* 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 #undef p_area
}
} }
} }
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
...@@ -441,7 +474,10 @@ gint E_(GtkModeManage)( intf_thread_t * p_intf ) ...@@ -441,7 +474,10 @@ gint E_(GtkModeManage)( intf_thread_t * p_intf )
/* initialize and show slider for seekable streams */ /* initialize and show slider for seekable streams */
if( p_intf->p_sys->p_input->stream.b_seekable ) 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 ), gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
"value_changed" ); "value_changed" );
gtk_widget_show( GTK_WIDGET( p_slider ) ); gtk_widget_show( GTK_WIDGET( p_slider ) );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.h: private Gtk+ interface description * familiar.h: private Gtk+ interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -40,11 +40,9 @@ struct intf_sys_t ...@@ -40,11 +40,9 @@ struct intf_sys_t
/* slider */ /* slider */
GtkLabel * p_slider_label; GtkLabel * p_slider_label;
GtkAdjustment * p_adj; /* slider adjustment object */ GtkAdjustment * p_adj; /* slider adjustment object */
#ifdef HAVE_STRONGARM off_t i_adj_oldvalue; /* previous value -no FPU hardware */
off_t f_adj_oldvalue; float f_adj_oldvalue; /* previous value -with FPU hardware*/
#else
float f_adj_oldvalue; /* previous value */
#endif
/* special actions */ /* special actions */
vlc_bool_t b_playing; vlc_bool_t b_playing;
vlc_bool_t b_window_changed; /* window display toggled ? */ vlc_bool_t b_window_changed; /* window display toggled ? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment