]> git.sesse.net Git - vlc/blobdiff - modules/packetizer/flac.c
contribs: .glib is no longer a valid target
[vlc] / modules / packetizer / flac.c
index c001ea73e87be14e44f802b393d4a3806b119d1d..449b88d490121c85ac7979dbdf94fd45d78b3aa6 100644 (file)
@@ -84,8 +84,9 @@ struct decoder_sys_t
     date_t  end_date;
     mtime_t i_pts;
 
-    int i_frame_size, i_frame_length, i_bits_per_sample;
-    unsigned int i_rate, i_channels;
+    int i_frame_length;
+    size_t i_frame_size;
+    unsigned int i_rate, i_channels, i_bits_per_sample;
 };
 
 enum
@@ -104,7 +105,7 @@ enum
 static block_t *Packetize( decoder_t *, block_t ** );
 
 static int SyncInfo( decoder_t *, uint8_t *, unsigned int *,
-                     unsigned int *,int * );
+                     unsigned int *, unsigned int * );
 
 static uint64_t read_utf8( const uint8_t *p_buf, int *pi_read );
 static uint8_t flac_crc8( const uint8_t *data, unsigned len );
@@ -206,7 +207,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
     if( !p_sys->b_stream_info )
         ProcessHeader( p_dec );
 
-    if( p_sys->stream_info.channels > 6 )
+    if( p_sys->stream_info.channels > 8 )
     {
         msg_Err( p_dec, "This stream uses too many audio channels" );
         return NULL;
@@ -371,7 +372,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
 static int SyncInfo( decoder_t *p_dec, uint8_t *p_buf,
                      unsigned int * pi_channels,
                      unsigned int * pi_sample_rate,
-                     int * pi_bits_per_sample )
+                     unsigned int * pi_bits_per_sample )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
     int i_header, i_temp, i_read;
@@ -600,6 +601,10 @@ static int SyncInfo( decoder_t *p_dec, uint8_t *p_buf,
         if( i_blocksize < p_sys->stream_info.min_blocksize ||
             i_blocksize > p_sys->stream_info.max_blocksize )
             return 0;
+        if( *pi_bits_per_sample != p_sys->stream_info.bits_per_sample )
+            return 0;
+        if( *pi_sample_rate != p_sys->stream_info.sample_rate )
+            return 0;
     }
     return i_blocksize;
 }