aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZane van Iperen <zane@zanevaniperen.com>2020-09-05 21:30:12 +1000
committerZane van Iperen <zane@zanevaniperen.com>2020-11-08 00:16:49 +1000
commit4fdc632a9005c580613c15f5ccf42302c4643c73 (patch)
treead4fceb5dbff9cc3d0053ca2b76807123a2dbd2b
parentc19641b2e2acf5a0665ddf3725b8a4a8bd7059e1 (diff)
downloadffmpeg-4fdc632a9005c580613c15f5ccf42302c4643c73.tar.gz
avformat/argo_asf: fix handling of v1.1 files
Version 1.1 (FX Fighter) files all have a sample rate of 44100 in the header, but only play back correctly at 22050. Force the sample rate to 22050 when reading, and restrict it when muxing. (cherry picked from commit d2f7b399149f725138f5551ae980e755596d527c)
-rw-r--r--libavformat/argo_asf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/argo_asf.c b/libavformat/argo_asf.c
index 3339425244..abc6e51baa 100644
--- a/libavformat/argo_asf.c
+++ b/libavformat/argo_asf.c
@@ -175,7 +175,11 @@ static int argo_asf_read_header(AVFormatContext *s)
st->codecpar->channels = 1;
}
- st->codecpar->sample_rate = asf->ckhdr.sample_rate;
+ /* v1.1 files (FX Fighter) are all marked as 44100, but are actually 22050. */
+ if (asf->fhdr.version_major == 1 && asf->fhdr.version_minor == 1)
+ st->codecpar->sample_rate = 22050;
+ else
+ st->codecpar->sample_rate = asf->ckhdr.sample_rate;
st->codecpar->bits_per_coded_sample = 4;