]> git.sesse.net Git - vlc/commitdiff
* output.c: avoid a floating point exception when aout-rate==0
authorCyril Deguet <asmax@videolan.org>
Tue, 22 Apr 2003 19:26:02 +0000 (19:26 +0000)
committerCyril Deguet <asmax@videolan.org>
Tue, 22 Apr 2003 19:26:02 +0000 (19:26 +0000)
* gtk2_api.cpp: made valgrind happy ;)

modules/gui/skins/gtk2/gtk2_api.cpp
modules/gui/skins/src/skin_main.cpp
src/audio_output/output.c

index 3ee889e8a698960ec23f210034610f6e5b41464d..5534251b734e8e95fa88cb17127a420f76e44a21 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_api.cpp: Various gtk2-specific functions
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_api.cpp,v 1.13 2003/04/21 21:51:16 asmax Exp $
+ * $Id: gtk2_api.cpp,v 1.14 2003/04/22 19:26:02 asmax Exp $
  *
  * Authors: Cyril Deguet  <asmax@videolan.org>
  *
@@ -52,19 +52,25 @@ void OSAPI_SendMessage( SkinWindow *win, unsigned int message, unsigned int para
 void OSAPI_PostMessage( SkinWindow *win, unsigned int message, unsigned int param1,
                         long param2 )
 {
-    GdkEventClient *event = new GdkEventClient;
+    GdkEventClient *event = (GdkEventClient *) new GdkEvent;
     
     event->type = GDK_CLIENT_EVENT;
     if( win == NULL )
+    {
         event->window = NULL;
+    }
     else
+    {
         event->window = ((GTK2Window *)win)->GetHandle();
+    }
     event->send_event = 0;
     event->message_type = NULL;
     event->data_format = 32;
     event->data.l[0] = message;
     event->data.l[1] = param1;
     event->data.l[2] = param2;
+    event->data.l[3] = 0;
+    event->data.l[4] = 0;
 
     gdk_event_put( (GdkEvent *)event );
 
index 57772b2e91e81942bf22e179548c437dd235c2a0..50b15941ad04c374c90e87984f3ff2b521db8ba1 100644 (file)
@@ -2,7 +2,7 @@
  * skin-main.cpp: skins plugin for VLC
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.16 2003/04/21 18:39:39 asmax Exp $
+ * $Id: skin_main.cpp,v 1.17 2003/04/22 19:26:02 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -107,8 +107,8 @@ static int Open ( vlc_object_t *p_this )
 
 #if !defined WIN32
     // Initialize GDK
-    int    i_args   = 1;
-    char  *p_args[] = { "", NULL };
+    int    i_args   = 3;
+    char  *p_args[] = { "", "", "--sync", NULL };
     char **pp_args  = p_args;
 
     gdk_init( &i_args, &pp_args );
index 1a70b9e5b0d30fb00e7d701572ccc527f0a1e15a..62a6f421b4da81f6ee82494eabe9dd03b781ba56 100644 (file)
@@ -2,7 +2,7 @@
  * output.c : internal management of output streams for the audio output
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: output.c,v 1.36 2003/02/08 17:26:00 massiot Exp $
+ * $Id: output.c,v 1.37 2003/04/22 19:26:02 asmax Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -44,6 +44,8 @@ int aout_OutputNew( aout_instance_t * p_aout,
     char * psz_name = config_GetPsz( p_aout, "aout" );
     int i_rate = config_GetInt( p_aout, "aout-rate" );
     vlc_value_t val;
+    /* kludge to avoid a fpu error when rate is 0... */
+    if( i_rate == 0 ) i_rate = -1;
 
     memcpy( &p_aout->output.output, p_format, sizeof(audio_sample_format_t) );
     if ( i_rate != -1 )