summaryrefslogtreecommitdiff
path: root/libavformat/apm.c
diff options
context:
space:
mode:
authorZane van Iperen <zane@zanevaniperen.com>2020-07-08 00:42:09 +1000
committerZane van Iperen <zane@zanevaniperen.com>2020-07-19 14:42:51 +1000
commit1b0a0da63a279804df04292cf452b2acdd87b687 (patch)
tree5241831b47b9fd2c92cf46dc83da9933bb1f7ca2 /libavformat/apm.c
parent3bf1be210150b435c51c7c8eb8fd05a1fca08814 (diff)
avformat/apm: use the entire APMState structure as extradata
Is the "actual" codec extradata instead of the hand-crafted one from the previous revision.
Diffstat (limited to 'libavformat/apm.c')
-rw-r--r--libavformat/apm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavformat/apm.c b/libavformat/apm.c
index 4158b81457..8d655d0a33 100644
--- a/libavformat/apm.c
+++ b/libavformat/apm.c
@@ -26,6 +26,7 @@
#define APM_FILE_HEADER_SIZE 18
#define APM_FILE_EXTRADATA_SIZE 80
+#define APM_EXTRADATA_SIZE 28
#define APM_MAX_READ_SIZE 4096
@@ -160,13 +161,11 @@ static int apm_read_header(AVFormatContext *s)
return AVERROR_PATCHWELCOME;
}
- if ((ret = ff_alloc_extradata(st->codecpar, 16)) < 0)
+ if ((ret = ff_alloc_extradata(st->codecpar, APM_EXTRADATA_SIZE)) < 0)
return ret;
- AV_WL32(st->codecpar->extradata + 0, vs12.state.predictor_l);
- AV_WL32(st->codecpar->extradata + 4, vs12.state.step_index_l);
- AV_WL32(st->codecpar->extradata + 8, vs12.state.predictor_r);
- AV_WL32(st->codecpar->extradata + 12, vs12.state.step_index_r);
+ /* Use the entire state as extradata. */
+ memcpy(st->codecpar->extradata, buf + 20, APM_EXTRADATA_SIZE);
avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
st->start_time = 0;