]> git.sesse.net Git - vlc/blobdiff - modules/codec/speex.c
adpcm: use VLC_TS_INVALID (refs #3135)
[vlc] / modules / codec / speex.c
index eb844047f13070c0f7dd5bfa5dd638ac49ff565d..f331c82be81d8111257bf7a4d3826301f038e619 100644 (file)
@@ -306,9 +306,8 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     {
         uint8_t *p_extra;
 
-        p_dec->fmt_in.p_extra =
-            realloc( p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra +
-                     oggpacket.bytes + 2 );
+        p_dec->fmt_in.p_extra = xrealloc( p_dec->fmt_in.p_extra,
+                                p_dec->fmt_in.i_extra + oggpacket.bytes + 2 );
         p_extra = ((uint8_t *)p_dec->fmt_in.p_extra) + p_dec->fmt_in.i_extra;
         *(p_extra++) = oggpacket.bytes >> 8;
         *(p_extra++) = oggpacket.bytes & 0xFF;
@@ -392,8 +391,8 @@ static int ProcessHeaders( decoder_t *p_dec )
     if( p_sys->b_packetizer )
     {
         p_dec->fmt_out.i_extra = p_dec->fmt_in.i_extra;
-        p_dec->fmt_out.p_extra =
-            realloc( p_dec->fmt_out.p_extra, p_dec->fmt_out.i_extra );
+        p_dec->fmt_out.p_extra = xrealloc( p_dec->fmt_out.p_extra,
+                                                  p_dec->fmt_out.i_extra );
         memcpy( p_dec->fmt_out.p_extra,
                 p_dec->fmt_in.p_extra, p_dec->fmt_out.i_extra );
     }
@@ -529,7 +528,7 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
            block_t *p_new_block = NULL;
 
            i_pcm_output_size = p_sys->p_header->frame_size;
-           p_frame_holder = (short*)malloc( sizeof(short)*i_pcm_output_size );
+           p_frame_holder = (short*)xmalloc( sizeof(short)*i_pcm_output_size );
 
             speex_bits_read_from( &p_sys->bits, (char*)p_oggpacket->packet,
                p_oggpacket->bytes);
@@ -712,7 +711,7 @@ static aout_buffer_t *DecodeRtpSpeexPacket( decoder_t *p_dec, block_t **pp_block
       Handle date management on the audio output buffer. 
     */
     p_aout_buffer->i_pts = date_Get( &p_sys->end_date );
-    p_aout_buffer->end_date = date_Increment( &p_sys->end_date, 
+    p_aout_buffer->i_length = date_Increment( &p_sys->end_date,
         p_sys->p_header->frame_size ) - p_aout_buffer->i_pts;
     
     
@@ -1000,7 +999,7 @@ static int OpenEncoder( vlc_object_t *p_this )
 
     p_sys->i_frame_size = p_sys->i_frame_length *
         sizeof(int16_t) * p_enc->fmt_in.audio.i_channels;
-    p_sys->p_buffer = malloc( p_sys->i_frame_size );
+    p_sys->p_buffer = xmalloc( p_sys->i_frame_size );
 
     /* Create and store headers */
     pp_header[0] = speex_header_to_packet( &p_sys->header, &pi_header[0] );
@@ -1008,7 +1007,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     pi_header[1] = sizeof("ENCODER=VLC media player");
 
     p_enc->fmt_out.i_extra = 3 * 2 + pi_header[0] + pi_header[1];
-    p_extra = p_enc->fmt_out.p_extra = malloc( p_enc->fmt_out.i_extra );
+    p_extra = p_enc->fmt_out.p_extra = xmalloc( p_enc->fmt_out.i_extra );
     for( i = 0; i < 2; i++ )
     {
         *(p_extra++) = pi_header[i] >> 8;