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 d2f7b39914)
This commit is contained in:
Zane van Iperen 2020-09-05 21:30:12 +10:00
parent c19641b2e2
commit 4fdc632a90
No known key found for this signature in database
GPG Key ID: 68616B2D8AC4DCC5
1 changed files with 5 additions and 1 deletions

View File

@ -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;