pkt->pos = pos;
if (avio_read(pb, pkt->data, pkt->size) < pkt->size) {
- av_packet_unref(pkt);
return AVERROR_EOF;
}
if (!s->nb_streams) {
AVStream *st = avformat_new_stream(s, NULL);
if (!st) {
- av_packet_unref(pkt);
return AVERROR(ENOMEM);
}
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;