- /* non-audio block types can be skipped */
- case 4:
- case 5:
- if( stream_Read( p_demux->s, NULL, i_block_size ) < i_block_size )
+ new_fmt.i_codec = VLC_CODEC_U8;
+ new_fmt.audio.i_channels = buf[3] + 1; /* can't be nul */
+ new_fmt.audio.i_rate = 256000000L /
+ ((65536L - GetWLE(buf)) * new_fmt.audio.i_channels);
+ new_fmt.audio.i_bytes_per_frame = new_fmt.audio.i_channels;
+ new_fmt.audio.i_frame_length = 1;
+ new_fmt.audio.i_blockalign = new_fmt.audio.i_bytes_per_frame;
+ new_fmt.audio.i_bitspersample = 8 * new_fmt.audio.i_bytes_per_frame;
+ new_fmt.i_bitrate = new_fmt.audio.i_rate * 8;
+
+ /* read subsequent block 1 */
+ if( stream_Read( p_demux->s, buf, 4 ) < 4 )
+ return VLC_EGENERIC; /* EOF */
+
+ i_block_size = GetDWLE( buf ) >> 8;
+ msg_Dbg( p_demux, "new block: type: %u, size: %u",
+ (unsigned)*buf, i_block_size );
+ if( i_block_size < 2 )
+ goto corrupt;
+ i_block_size -= 2;
+
+ if( stream_Read( p_demux->s, buf, 2 ) < 2 )
+ goto corrupt;
+
+ if( buf[1] )
+ {
+ msg_Err( p_demux, "unsupported compression" );