]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/transcode.c
Removes trailing spaces. Removes tabs.
[vlc] / modules / stream_out / transcode.c
index db966b12b06dfbd3a8815a4231ca6678ebd60c2e..c44108e10364cd54ecdbf91931b35a2f5dd81947 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
 #include <vlc/vlc.h>
 #include <vlc_input.h>
 #include <vlc_sout.h>
@@ -40,6 +36,8 @@
 #include <vlc_filter.h>
 #include <vlc_osd.h>
 
+#include <math.h>
+
 #define MASTER_SYNC_MAX_DRIFT 100000
 
 /* FIXME Ugly */
 #define HURRYUP_LONGTEXT N_( "The transcoder will drop frames if your CPU " \
                 "can't keep up with the encoding rate." )
 
-static char *ppsz_deinterlace_type[] =
+static const char *ppsz_deinterlace_type[] =
 {
     "deinterlace", "ffmpeg-deinterlace"
 };
@@ -798,6 +796,15 @@ static void Close( vlc_object_t * p_this )
 
     sout_StreamDelete( p_sys->p_out );
 
+    while( p_sys->i_afilters )
+    {
+        p_sys->i_afilters--;
+        if( p_sys->psz_afilters[p_sys->i_afilters] )
+            free( p_sys->psz_afilters[p_sys->i_afilters] );
+        if( p_sys->p_afilters_cfg[p_sys->i_afilters] )
+            free( p_sys->p_afilters_cfg[p_sys->i_afilters] );
+    }
+
     while( p_sys->p_audio_cfg != NULL )
     {
         config_chain_t *p_next = p_sys->p_audio_cfg->p_next;
@@ -812,6 +819,15 @@ static void Close( vlc_object_t * p_this )
     }
     if( p_sys->psz_aenc ) free( p_sys->psz_aenc );
 
+    while( p_sys->i_vfilters )
+    {
+        p_sys->i_vfilters--;
+        if( p_sys->psz_vfilters[p_sys->i_vfilters] )
+            free( p_sys->psz_vfilters[p_sys->i_vfilters] );
+        if( p_sys->p_vfilters_cfg[p_sys->i_vfilters] )
+            free( p_sys->p_vfilters_cfg[p_sys->i_vfilters] );
+    }
+
     while( p_sys->p_video_cfg != NULL )
     {
         config_chain_t *p_next = p_sys->p_video_cfg->p_next;
@@ -1303,7 +1319,7 @@ static int transcode_audio_new( sout_stream_t *p_stream,
         msg_Err( p_stream, "cannot find decoder" );
         return VLC_EGENERIC;
     }
-    id->p_decoder->fmt_out.audio.i_bitspersample = 
+    id->p_decoder->fmt_out.audio.i_bitspersample =
         audio_BitsPerSample( id->p_decoder->fmt_out.i_codec );
     fmt_last = id->p_decoder->fmt_out;
     /* Fix AAC SBR changing number of channels and sampling rate */
@@ -1619,6 +1635,7 @@ static aout_buffer_t *audio_new_buffer( decoder_t *p_dec, int i_samples )
     }
 
     p_buffer = malloc( sizeof(aout_buffer_t) );
+    p_buffer->b_discontinuity = VLC_FALSE;
     p_buffer->pf_release = audio_release_buffer;
     p_buffer->p_sys = p_block = block_New( p_dec, i_size );