diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-01-02 16:21:46 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-01-02 16:21:46 +0100 |
commit | 1139887ace7f15053527cbc8b0a354899bcfcf63 (patch) | |
tree | 805ee82d58e638da34cb345829d70db3afcf7df2 /libavformat/acm.c | |
parent | 25c7aa9974af21eaae97f85bcc83e1d815ba6f6b (diff) | |
download | ffmpeg-1139887ace7f15053527cbc8b0a354899bcfcf63.tar.gz |
avformat/acm: use ff_get_extradata()
Diffstat (limited to 'libavformat/acm.c')
-rw-r--r-- | libavformat/acm.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavformat/acm.c b/libavformat/acm.c index 08dd9282fa..dcf8778dc7 100644 --- a/libavformat/acm.c +++ b/libavformat/acm.c @@ -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); |