GF_Err gf_isom_audio_sample_entry_read(GF_AudioSampleEntryBox *ptr, GF_BitStream *bs)
{
	GF_Err e;
	ISOM_DECREASE_SIZE(ptr, 28)

	e = gf_isom_base_sample_entry_read((GF_SampleEntryBox *)ptr, bs);
	if (e) return e;

	ptr->version = gf_bs_read_u16(bs);
	ptr->revision = gf_bs_read_u16(bs);
	ptr->vendor = gf_bs_read_u32(bs);
	ptr->channel_count = gf_bs_read_u16(bs);
	ptr->bitspersample = gf_bs_read_u16(bs);
	ptr->compression_id = gf_bs_read_u16(bs);
	ptr->packet_size = gf_bs_read_u16(bs);
	ptr->samplerate_hi = gf_bs_read_u16(bs);
	ptr->samplerate_lo = gf_bs_read_u16(bs);

	if (!ptr->qtff_mode) return GF_OK;
	//QT only
	if (ptr->version==1) {
		ISOM_DECREASE_SIZE(ptr, 16)
		gf_bs_read_data(bs, (char *) ptr->extensions, 16);
	} else if (ptr->version==2) {
		ISOM_DECREASE_SIZE(ptr, 36)
		gf_bs_read_data(bs,  (char *) ptr->extensions, 36);
	}
	return GF_OK;
}
GF_Err gf_isom_audio_sample_entry_read(GF_AudioSampleEntryBox *ptr, GF_BitStream *bs)
{
	GF_Err e;
	ISOM_DECREASE_SIZE(ptr, 28)

	e = gf_isom_base_sample_entry_read((GF_SampleEntryBox *)ptr, bs);
	if (e) return e;

	ptr->version = gf_bs_read_u16(bs);
	ptr->revision = gf_bs_read_u16(bs);
	ptr->vendor = gf_bs_read_u32(bs);
	ptr->channel_count = gf_bs_read_u16(bs);
	ptr->bitspersample = gf_bs_read_u16(bs);
	ptr->compression_id = gf_bs_read_u16(bs);
	ptr->packet_size = gf_bs_read_u16(bs);
	ptr->samplerate_hi = gf_bs_read_u16(bs);
	ptr->samplerate_lo = gf_bs_read_u16(bs);

	if (!ptr->qtff_mode) return GF_OK;
	 
	if (ptr->version==1) {
		ISOM_DECREASE_SIZE(ptr, 16)
		gf_bs_read_data(bs, (char *) ptr->extensions, 16);
	} else if (ptr->version==2) {
		ISOM_DECREASE_SIZE(ptr, 36)
		gf_bs_read_data(bs,  (char *) ptr->extensions, 36);
	}
	return GF_OK;
}