*pi_sample_rate = pi_sample_rates[i_sample_rate_idx];
//private_bit = (p_buf[2] >> 1) & 0x01;
*pi_channels = ((p_buf[2] & 0x01) << 2) | ((p_buf[3] >> 6) & 0x03);
+ if (*pi_channels == 0) /* workaround broken streams */
+ *pi_channels = 2;
//original_copy = (p_buf[3] >> 5) & 0x01;
//home = (p_buf[3] >> 4) & 0x01;
//uint16_t buffer_fullness = ((p_buf[5] & 0x1f) << 6) | (p_buf[6] >> 2);
unsigned short i_raw_blocks_in_frame = p_buf[6] & 0x03;
- if( !*pi_sample_rate || !*pi_channels || !i_frame_size )
+ if( !*pi_sample_rate || !i_frame_size )
{
msg_Warn( p_dec, "Invalid ADTS header" );
return 0;