summaryrefslogtreecommitdiff
path: root/libavformat/argo_brp.c
diff options
context:
space:
mode:
authorZane van Iperen <zane@zanevaniperen.com>2020-09-25 22:25:42 +1000
committerZane van Iperen <zane@zanevaniperen.com>2020-09-27 09:11:36 +1000
commit3ffb15a105f88544b6b93bb32c9ac9f62b90f456 (patch)
tree799e92d7dee5dc2acf45166ed701345c4f42da88 /libavformat/argo_brp.c
parent97efac3ac11a3a6f799f1e32e5eb49e50e0d5042 (diff)
avformat/argo_brp: allow v1.1 ASF streams to have a non-22050 sample rate in certain circumstances
It seems that in files where the BASF block isn't first, v1.1 ASF streams are allowed to be non-22050. Either this format is really inconsistent, or FX Fighter and Croc just ignored the sample rate field, requiring the v1.1 restriction in the first place. This bumps the version to 1.2 in these streams so they're not "corrected". Found in Alien Odyssey games files in: ./GRAPHICS/COMMBUNK/{{COMADD1,COMM2_{1,2,3E},COMM3_{2,3,4,5,6}},FADE{1,2}}.BRP Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Diffstat (limited to 'libavformat/argo_brp.c')
-rw-r--r--libavformat/argo_brp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/argo_brp.c b/libavformat/argo_brp.c
index 4041183011..af64a0d6dc 100644
--- a/libavformat/argo_brp.c
+++ b/libavformat/argo_brp.c
@@ -323,6 +323,20 @@ static int argo_brp_read_header(AVFormatContext *s)
ff_argo_asf_parse_chunk_header(&brp->basf.ckhdr, buf);
+ /*
+ * Special Case Hack. It seems that in files where the BASF block isn't first,
+ * v1.1 streams are allowed to be non-22050...
+ * Bump the version to 1.2 so ff_argo_asf_fill_stream() doesn't "correct" it.
+ *
+ * Found in Alien Odyssey games files in:
+ * ./GRAPHICS/COMMBUNK/{{COMADD1,COMM2_{1,2,3E},COMM3_{2,3,4,5,6}},FADE{1,2}}.BRP
+ *
+ * Either this format really inconsistent, or FX Fighter and Croc just ignored the
+ * sample rate field...
+ */
+ if (i != 0 && hdr->extradata.basf.version_major == 1 && hdr->extradata.basf.version_minor == 1)
+ hdr->extradata.basf.version_minor = 2;
+
if ((ret = ff_argo_asf_fill_stream(s, st, &hdr->extradata.basf, &brp->basf.ckhdr)) < 0)
return ret;