1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avformat/argo_asf: fix enforcement of chunk count

Enforcing num_chunks == 1 only makes sense when demuxing from an ASF
file. When embedded in a BRP file, an ASF stream can have multiple chunks.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
This commit is contained in:
Zane van Iperen 2020-09-19 12:35:42 +10:00
parent ef29e5bf42
commit 101ac40f69
No known key found for this signature in database
GPG Key ID: 68616B2D8AC4DCC5

View File

@ -59,11 +59,6 @@ int ff_argo_asf_validate_file_header(AVFormatContext *s, const ArgoASFFileHeader
if (hdr->magic != ASF_TAG || hdr->num_chunks == 0)
return AVERROR_INVALIDDATA;
if (hdr->num_chunks > 1) {
avpriv_request_sample(s, ">1 chunk");
return AVERROR_PATCHWELCOME;
}
if (hdr->chunk_offset < ASF_FILE_HEADER_SIZE)
return AVERROR_INVALIDDATA;
@ -139,8 +134,12 @@ int ff_argo_asf_fill_stream(AVStream *st, const ArgoASFFileHeader *fhdr,
avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
st->start_time = 0;
if (fhdr->num_chunks == 1) {
st->duration = ckhdr->num_blocks * ckhdr->num_samples;
st->nb_frames = ckhdr->num_blocks;
}
return 0;
}
@ -199,6 +198,10 @@ static int argo_asf_read_header(AVFormatContext *s)
if ((ret = ff_argo_asf_validate_file_header(s, &asf->fhdr)) < 0)
return ret;
/* This should only be 1 in ASF files. >1 is fine if in BRP. */
if (asf->fhdr.num_chunks != 1)
return AVERROR_INVALIDDATA;
if ((ret = avio_skip(pb, asf->fhdr.chunk_offset - ASF_FILE_HEADER_SIZE)) < 0)
return ret;