- // NOTE: there is also data length information in the
- // field information, it might be better to take this into account
- // as well.
+ if (st->codec->codec_id == CODEC_ID_PCM_S24LE ||
+ st->codec->codec_id == CODEC_ID_PCM_S16LE) {
+ int first = field_info >> 16;
+ int last = field_info & 0xffff; // last is exclusive
+ int bps = av_get_bits_per_sample(st->codec->codec_id)>>3;
+ if (first <= last && last*bps <= pkt_len) {
+ url_fskip(pb, first*bps);
+ skip = pkt_len - last*bps;
+ pkt_len = (last-first)*bps;
+ } else
+ av_log(s, AV_LOG_ERROR, "invalid first and last sample values\n");
+ }