From 4fdc632a9005c580613c15f5ccf42302c4643c73 Mon Sep 17 00:00:00 2001 From: Zane van Iperen Date: Sat, 5 Sep 2020 21:30:12 +1000 Subject: [PATCH] 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) --- libavformat/argo_asf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;