From 85faf5c580984877c07392b099d1cd4181c11512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 19 May 2007 21:44:01 +0000 Subject: [PATCH] Same as previous commit --- modules/gui/macosx/voutqt.m | 4 ++-- modules/gui/pda/pda.c | 6 +++--- src/audio_output/output.c | 2 +- src/modules/modules.c | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/gui/macosx/voutqt.m b/modules/gui/macosx/voutqt.m index 4f737fc293..3a7e0ee69d 100644 --- a/modules/gui/macosx/voutqt.m +++ b/modules/gui/macosx/voutqt.m @@ -146,8 +146,8 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this ) else p_vout->p_sys->b_embedded = VLC_FALSE; - p_vout->p_sys->b_cpu_has_simd = (p_vout->p_libvlc_global->i_cpu & CPU_CAPABILITY_ALTIVEC) - | (p_vout->p_libvlc_global->i_cpu & CPU_CAPABILITY_MMXEXT); + p_vout->p_sys->b_cpu_has_simd = + vlc_CPU() & (CPU_CAPABILITY_ALTIVEC|CPU_CAPABILITY_MMXEXT); msg_Dbg( p_vout, "we do%s have SIMD enabled CPU", p_vout->p_sys->b_cpu_has_simd ? "" : "n't" ); /* Initialize QuickTime */ diff --git a/modules/gui/pda/pda.c b/modules/gui/pda/pda.c index d3a86cbee9..e891a1ba6b 100644 --- a/modules/gui/pda/pda.c +++ b/modules/gui/pda/pda.c @@ -326,7 +326,7 @@ static void Run( intf_thread_t *p_intf ) /* Sleep to avoid using all CPU - since some interfaces need to * access keyboard events, a 100ms delay is a good compromise */ gdk_threads_leave(); - if (p_intf->p_libvlc_global->i_cpu & CPU_CAPABILITY_FPU) + if (vlc_CPU() & CPU_CAPABILITY_FPU) msleep( INTF_IDLE_SLEEP ); else msleep( 1000 ); @@ -336,7 +336,7 @@ static void Run( intf_thread_t *p_intf ) msg_Dbg( p_intf, "Manage GTK keyboard events using timeouts" ); /* Sleep to avoid using all CPU - since some interfaces needs to access * keyboard events, a 1000ms delay is a good compromise */ - if (p_intf->p_libvlc_global->i_cpu & CPU_CAPABILITY_FPU) + if (vlc_CPU() & CPU_CAPABILITY_FPU) i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, (GtkFunction)Manage, p_intf ); else i_dummy = gtk_timeout_add( 1000, (GtkFunction)Manage, p_intf ); @@ -447,7 +447,7 @@ static int Manage( intf_thread_t *p_intf ) i_time = var_GetTime( p_intf->p_sys->p_input, "time" ); i_length = var_GetTime( p_intf->p_sys->p_input, "length" ); - if (p_intf->p_libvlc_global->i_cpu & CPU_CAPABILITY_FPU) + if (vlc_CPU() & CPU_CAPABILITY_FPU) { /* Manage the slider for CPU_CAPABILITY_FPU hardware */ if( p_intf->p_sys->b_playing ) diff --git a/src/audio_output/output.c b/src/audio_output/output.c index 4120e78615..4b55564571 100644 --- a/src/audio_output/output.c +++ b/src/audio_output/output.c @@ -175,7 +175,7 @@ int aout_OutputNew( aout_instance_t * p_aout, { /* Non-S/PDIF mixer only deals with float32 or fixed32. */ p_aout->mixer.mixer.i_format - = (p_aout->p_libvlc_global->i_cpu & CPU_CAPABILITY_FPU) ? + = (vlc_CPU() & CPU_CAPABILITY_FPU) ? VLC_FOURCC('f','l','3','2') : VLC_FOURCC('f','i','3','2'); aout_FormatPrepare( &p_aout->mixer.mixer ); diff --git a/src/modules/modules.c b/src/modules/modules.c index f10ed54913..f80f09564c 100644 --- a/src/modules/modules.c +++ b/src/modules/modules.c @@ -76,6 +76,7 @@ #endif #include "modules/configuration.h" +#include "libvlc.h" #include "vlc_interface.h" #include "vlc_playlist.h" @@ -481,6 +482,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability, p_all = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = malloc( p_all->i_count * sizeof( module_list_t ) ); p_first = NULL; + unsigned i_cpu = vlc_CPU(); /* Parse the module list for capabilities and probe each of them */ for( i_which_module = 0; i_which_module < p_all->i_count; i_which_module++ ) @@ -498,7 +500,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability, } /* Test if we have the required CPU */ - if( (p_module->i_cpu & p_this->p_libvlc_global->i_cpu) != p_module->i_cpu ) + if( (p_module->i_cpu & i_cpu) != p_module->i_cpu ) { continue; }