]> git.sesse.net Git - vlc/blobdiff - modules/packetizer/flac.c
opengl: use vertex/texture array instead of glBegin/glEnd
[vlc] / modules / packetizer / flac.c
index d9a2be3b4f8ff2fd187268b88f701ecc2dc07201..1fef09abde9ef38f3e51e1bc0d6dff266fb5ffeb 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <vlc_block_helper.h>
 #include <vlc_bits.h>
+#include "packetizer_helper.h"
 
 /*****************************************************************************
  * Module descriptor
@@ -89,16 +90,6 @@ struct decoder_sys_t
     unsigned int i_rate, i_channels, i_bits_per_sample;
 };
 
-enum
-{
-    STATE_NOSYNC,
-    STATE_SYNC,
-    STATE_HEADER,
-    STATE_NEXT_SYNC,
-    STATE_GET_DATA,
-    STATE_SEND_DATA
-};
-
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
@@ -127,7 +118,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->i_state       = STATE_NOSYNC;
     p_sys->b_stream_info = false;
     p_sys->i_pts         = VLC_TS_INVALID;
-    p_sys->bytestream    = block_BytestreamInit();
+    block_BytestreamInit( &p_sys->bytestream );
 
     /* */
     es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
@@ -422,6 +413,10 @@ static int SyncInfo( decoder_t *p_dec, uint8_t *p_buf,
         i_blocksize = 256 << (i_temp - 8);
         break;
     }
+    if( p_sys->b_stream_info &&
+        ( i_blocksize < p_sys->stream_info.min_blocksize ||
+          i_blocksize > p_sys->stream_info.max_blocksize ) )
+        return 0;
 
     /* Find samplerate */
     switch( i_temp = p_buf[2] & 0x0f )