+ /* 14 bits, little endian version of the bitstream */
+ if( p_buf[0] == 0xff && p_buf[1] == 0x1f &&
+ p_buf[2] == 0x00 && p_buf[3] == 0xe8 &&
+ (p_buf[4] & 0xf0) == 0xf0 && p_buf[5] == 0x07 )
+ {
+ uint8_t conv_buf[DTS_HEADER_SIZE];
+ Buf14To16( conv_buf, p_buf, DTS_HEADER_SIZE, 1 );
+ i_frame_size = SyncInfo16be( conv_buf, &i_audio_mode, pi_sample_rate,
+ pi_bit_rate, pi_frame_length );
+ i_frame_size = i_frame_size * 8 / 14 * 2;
+ }
+ /* 14 bits, big endian version of the bitstream */
+ else if( p_buf[0] == 0x1f && p_buf[1] == 0xff &&
+ p_buf[2] == 0xe8 && p_buf[3] == 0x00 &&
+ p_buf[4] == 0x07 && (p_buf[5] & 0xf0) == 0xf0 )
+ {
+ uint8_t conv_buf[DTS_HEADER_SIZE];
+ Buf14To16( conv_buf, p_buf, DTS_HEADER_SIZE, 0 );
+ i_frame_size = SyncInfo16be( conv_buf, &i_audio_mode, pi_sample_rate,
+ pi_bit_rate, pi_frame_length );
+ i_frame_size = i_frame_size * 8 / 14 * 2;
+ }
+ /* 16 bits, big endian version of the bitstream */
+ else if( p_buf[0] == 0x7f && p_buf[1] == 0xfe &&
+ p_buf[2] == 0x80 && p_buf[3] == 0x01 )
+ {
+ i_frame_size = SyncInfo16be( p_buf, &i_audio_mode, pi_sample_rate,
+ pi_bit_rate, pi_frame_length );
+ }
+ /* 16 bits, little endian version of the bitstream */
+ else if( p_buf[0] == 0xfe && p_buf[1] == 0x7f &&
+ p_buf[2] == 0x01 && p_buf[3] == 0x80 )
+ {
+ uint8_t conv_buf[DTS_HEADER_SIZE];
+ BufLeToBe( conv_buf, p_buf, DTS_HEADER_SIZE );
+ i_frame_size = SyncInfo16be( p_buf, &i_audio_mode, pi_sample_rate,
+ pi_bit_rate, pi_frame_length );
+ }
+ else return 0;