mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 08:12:44 +00:00
avformat/acm: use ff_get_extradata()
This commit is contained in:
parent
25c7aa9974
commit
1139887ace
@ -44,12 +44,9 @@ static int acm_read_header(AVFormatContext *s)
|
||||
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
st->codecpar->codec_id = AV_CODEC_ID_INTERPLAY_ACM;
|
||||
|
||||
ff_alloc_extradata(st->codecpar, 14);
|
||||
if (!st->codecpar->extradata)
|
||||
return AVERROR(ENOMEM);
|
||||
ret = avio_read(s->pb, st->codecpar->extradata, 14);
|
||||
if (ret < 10)
|
||||
return ret < 0 ? ret : AVERROR_EOF;
|
||||
ret = ff_get_extradata(s, st->codecpar, s->pb, 14);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
st->codecpar->channels = AV_RL16(st->codecpar->extradata + 8);
|
||||
st->codecpar->sample_rate = AV_RL16(st->codecpar->extradata + 10);
|
||||
|
Loading…
Reference in New Issue
Block a user