- /* for LPCM, we just skip the header and consider it is raw
- audio data */
- if (len <= 3)
- goto skip;
- avio_r8(s->pb); /* emphasis (1), muse(1), reserved(1), frame number(5) */
- b1 = avio_r8(s->pb); /* quant (2), freq(2), reserved(1), channels(3) */
- avio_r8(s->pb); /* dynamic range control (0x80 = off) */
- len -= 3;
- freq = (b1 >> 4) & 3;
- st->codec->sample_rate = lpcm_freq_tab[freq];
- st->codec->channels = 1 + (b1 & 7);
- st->codec->bits_per_coded_sample = 16 + ((b1 >> 6) & 3) * 4;
- st->codec->bit_rate = st->codec->channels *
- st->codec->sample_rate *
- st->codec->bits_per_coded_sample;
- if (st->codec->bits_per_coded_sample == 16)
- st->codec->codec_id = CODEC_ID_PCM_S16BE;
- else if (st->codec->bits_per_coded_sample == 28)
- return AVERROR(EINVAL);
- }
- av_new_packet(pkt, len);
- ret = avio_read(s->pb, pkt->data, pkt->size);
- if (ret < 0) {
- pkt->size = 0;
- } else if (ret < pkt->size) {
- pkt->size = ret;
- memset(pkt->data + ret, 0, FF_INPUT_BUFFER_PADDING_SIZE);
- }
- pkt->pts = pts;
- pkt->dts = dts;
- pkt->pos = dummy_pos;