]> git.sesse.net Git - vlc/commitdiff
* modules/codec/ffmpeg/encoder.c: fixed bug in the audio encoder.
authorGildas Bazin <gbazin@videolan.org>
Wed, 5 Nov 2003 17:46:21 +0000 (17:46 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 5 Nov 2003 17:46:21 +0000 (17:46 +0000)
* modules/gui/wxwindows/preferences_widgets.*: bug fix.

modules/codec/ffmpeg/encoder.c
modules/gui/wxwindows/preferences_widgets.cpp
modules/gui/wxwindows/preferences_widgets.h

index 422e06b490e9aa9150bbf4dcf4eb86f4c2b85d40..82c4f67efb8428ec41f7ad877712a6a0ddd96fa3 100644 (file)
@@ -2,7 +2,7 @@
  * encoder.c: video and audio encoder using the ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: encoder.c,v 1.3 2003/10/27 19:48:16 gbazin Exp $
+ * $Id: encoder.c,v 1.4 2003/11/05 17:46:21 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -71,12 +71,6 @@ struct encoder_sys_t
     AVCodec         *p_codec;
     AVCodecContext  *p_context;
 
-    /*
-     * Packetizer output properties
-     */
-    sout_packetizer_input_t *p_sout_input;
-    sout_format_t           sout_format;
-
     /*
      * Common properties
      */
@@ -424,7 +418,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
         if( i_samples_delay )
         {
             /* Take care of the left-over from last time */
-            int i_delay_size = i_samples_delay  * 2 *
+            int i_delay_size = i_samples_delay * 2 *
                                  p_sys->p_context->channels;
             int i_size = p_sys->i_frame_size - i_delay_size;
 
@@ -471,7 +465,8 @@ static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
     /* Backup the remaining raw samples */
     if( i_samples )
     {
-        memcpy( p_sys->p_buffer, p_buffer + i_samples_delay,
+        memcpy( p_sys->p_buffer, p_buffer + i_samples_delay * 2 *
+                p_sys->p_context->channels,
                 i_samples * 2 * p_sys->p_context->channels );
     }
 
index 6f4531ebe43e82dcdb4dcb5ca44c3e6b6c2881bb..56667a630bde8a19b2cdab62d44dd5fe33ae45c4 100644 (file)
@@ -2,7 +2,7 @@
  * preferences_widgets.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: preferences_widgets.cpp,v 1.11 2003/11/05 02:43:55 gbazin Exp $
+ * $Id: preferences_widgets.cpp,v 1.12 2003/11/05 17:46:21 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *          Sigmund Augdal <sigmunau@idi.ntnu.no>
@@ -111,15 +111,12 @@ ConfigControl::ConfigControl( vlc_object_t *_p_this,
     i_type( p_item->i_type ), b_advanced( p_item->b_advanced )
 {
     sizer = new wxBoxSizer( wxHORIZONTAL );
-    i_counter++;
 }
 
 ConfigControl::~ConfigControl()
 {
 }
 
-int ConfigControl::i_counter = 0;
-
 wxSizer *ConfigControl::Sizer()
 {
     return sizer;
@@ -422,7 +419,7 @@ void StringListConfigControl::UpdateCombo( module_config_t *p_item )
 
 BEGIN_EVENT_TABLE(StringListConfigControl, wxPanel)
     /* Button events */
-    EVT_BUTTON(wxID_HIGHEST+i_counter%100, StringListConfigControl::OnRefresh)
+    EVT_BUTTON(wxID_HIGHEST, StringListConfigControl::OnRefresh)
 END_EVENT_TABLE()
 
 void StringListConfigControl::OnRefresh( wxCommandEvent& event )
@@ -476,7 +473,7 @@ FileConfigControl::FileConfigControl( vlc_object_t *p_this,
 
 BEGIN_EVENT_TABLE(FileConfigControl, wxPanel)
     /* Button events */
-    EVT_BUTTON(wxID_HIGHEST+i_counter%100, FileConfigControl::OnBrowse)
+    EVT_BUTTON(wxID_HIGHEST, FileConfigControl::OnBrowse)
 END_EVENT_TABLE()
 
 void FileConfigControl::OnBrowse( wxCommandEvent& event )
@@ -551,7 +548,7 @@ int IntegerConfigControl::GetIntValue()
 IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *p_this,
                                                     module_config_t *p_item,
                                                     wxWindow *parent )
-  : ConfigControl( p_this, p_item, parent )
+  : ConfigControl( p_this, p_item, parent ), psz_name( NULL )
 {
     label = new wxStaticText(this, -1, wxU(p_item->psz_text));
     sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
@@ -608,7 +605,7 @@ void IntegerListConfigControl::UpdateCombo( module_config_t *p_item )
 
 BEGIN_EVENT_TABLE(IntegerListConfigControl, wxPanel)
     /* Button events */
-    EVT_BUTTON(wxID_HIGHEST+i_counter%100, IntegerListConfigControl::OnRefresh)
+    EVT_BUTTON(wxID_HIGHEST, IntegerListConfigControl::OnRefresh)
 END_EVENT_TABLE()
 
 void IntegerListConfigControl::OnRefresh( wxCommandEvent& event )
index 8f31c22951f416c7bc390a66866de477da2f8cce..2b943a482fe762d65fbcb5d2c404607ab14ebfba 100644 (file)
@@ -2,7 +2,7 @@
  * preferences_widgets.h : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2003 VideoLAN
- * $Id: preferences_widgets.h,v 1.5 2003/11/05 02:43:55 gbazin Exp $
+ * $Id: preferences_widgets.h,v 1.6 2003/11/05 17:46:21 gbazin Exp $
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *
@@ -40,7 +40,6 @@ protected:
     wxBoxSizer *sizer;
     wxStaticText *label;
     vlc_object_t *p_this;
-    static int i_counter;
 
 private:
     wxString name;
@@ -95,7 +94,6 @@ private:
 
     void OnRefresh( wxCommandEvent& );
     char *psz_name;
-    vlc_object_t *p_this;
     vlc_callback_t pf_list_update;
 
     void UpdateCombo( module_config_t *p_item );
@@ -138,7 +136,6 @@ private:
 
     void OnRefresh( wxCommandEvent& );
     char *psz_name;
-    vlc_object_t *p_this;
     vlc_callback_t pf_list_update;
 
     void UpdateCombo( module_config_t *p_item );