vlc error - possible fix (again)

Damian Ivereigh damian at cisco.com
Tue Sep 4 04:53:46 CEST 2001


Here is the patch in-line:-

---------------CUT-----------------------
*** vlc-0.2.83/src/ac3_decoder/ac3_decoder_thread.c	Thu Aug 23 03:13:10 2001
--- vlc-0.2.83.new/src/ac3_decoder/ac3_decoder_thread.c	Mon Sep  3 23:54:27 2001
***************
*** 84,89 ****
--- 84,90 ----
  
      /* Allocate the memory needed to store the thread's structure */
      p_ac3thread_temp = (ac3dec_thread_t *)malloc(sizeof(ac3dec_thread_t) + 15);
+     memset(p_ac3thread_temp, 0, sizeof(ac3dec_thread_t) + 15);
  
      /* We need to be 16 bytes aligned */
      p_ac3thread = (ac3dec_thread_t *)(((unsigned long)p_ac3thread_temp + 15)
*** vlc-0.2.83/src/ac3_spdif/ac3_spdif.c	Thu Aug 23 03:13:10 2001
--- vlc-0.2.83.new/src/ac3_spdif/ac3_spdif.c	Tue Sep  4 12:02:12 2001
***************
*** 82,87 ****
--- 82,96 ----
          return 0;
      }
      
+     /*
+      * Initialize the thread properties
+      */
+     memset(p_spdif, 0, sizeof(ac3_spdif_thread_t));
+     p_spdif->p_config = p_config;
+     p_spdif->p_fifo = p_config->decoder_config.p_decoder_fifo;
+ 
+     p_spdif->p_aout_fifo = NULL;
+ 
      /* Temporary buffer to store ac3 frames to be transformed */
      p_spdif->p_ac3 = malloc( SPDIF_FRAME_SIZE );
  
***************
*** 90,103 ****
          free( p_spdif->p_ac3 );
          return 0;
      }
! 
!     /*
!      * Initialize the thread properties
!      */
!     p_spdif->p_config = p_config;
!     p_spdif->p_fifo = p_config->decoder_config.p_decoder_fifo;
! 
!     p_spdif->p_aout_fifo = NULL;
  
      /* Spawn the ac3 to spdif thread */
      if (vlc_thread_create(&p_spdif->thread_id, "spdif", 
--- 99,105 ----
          free( p_spdif->p_ac3 );
          return 0;
      }
!     memset(p_spdif->p_ac3, 0, SPDIF_FRAME_SIZE);
  
      /* Spawn the ac3 to spdif thread */
      if (vlc_thread_create(&p_spdif->thread_id, "spdif", 
*** vlc-0.2.83/src/audio_decoder/audio_decoder.c	Thu Aug 23 03:13:10 2001
--- vlc-0.2.83.new//src/audio_decoder/audio_decoder.c	Tue Sep  4 11:59:19 2001
***************
*** 93,98 ****
--- 93,99 ----
      /*
       * Initialize the thread properties
       */
+     memset(p_adec, 0, sizeof(adec_thread_t));
      p_adec->p_config = p_config;
      p_adec->p_fifo = p_config->decoder_config.p_decoder_fifo;
---------------CUT-----------------------

  
On Tue, 2001-09-04 at 12:34, Damian Ivereigh wrote:
> 
> I have seen that too. I have tracked it down to some un-initialised
> memory in ac3_bit_allocate.c after a new decoder thread is created
> 
> This patch initialises the malloced memory to zero (and the same in
> ac3_spdif & audio_decoder - I don't know if this is necessary) and seems
> to fix it on one particular DVD I have.
> 
> Apply it your code and see if it helps.
> 
> Damian
> 
> > I notice I have quite a few DVDs that will play fine, untiul they hit
> > a particualt chapter, at which point they unceremoniously exist:
> > here's the vlc -vvv output. Of course these DVDs play fine on the
> > TV/dvd-player. This one is X-men (region 1). Machine is 1 GHz Athlon
> > machine running RedHat 7.1 with nVidia 32 MB card and upgraded kernel.
> > Any idea what is going on?
> 
> > Michael
> 
> 
-- 
Damian Ivereigh
CEPS Team Lead
http://wwwin-print.cisco.com
Desk: +61 2 8446 6344
Mob: +61 418 217 582





More information about the vlc mailing list