summaryrefslogtreecommitdiff
path: root/libavformat/argo_brp.c
diff options
context:
space:
mode:
authorZane van Iperen <zane@zanevaniperen.com>2020-09-19 22:02:42 +1000
committerZane van Iperen <zane@zanevaniperen.com>2020-09-20 19:21:00 +1000
commit3cf650bda92bb099f64e921d2450133a2aa82f20 (patch)
tree424ad02a33cb3de44a03ba4fb35a0e104aafc2c9 /libavformat/argo_brp.c
parent39801adc1956b3b9925567b88ecc0a93bd834384 (diff)
downloadffmpeg-3cf650bda92bb099f64e921d2450133a2aa82f20.tar.gz
avformat/argo_brp: remove an allocation
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Diffstat (limited to 'libavformat/argo_brp.c')
-rw-r--r--libavformat/argo_brp.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/libavformat/argo_brp.c b/libavformat/argo_brp.c
index 27029d07b1..d6f7eb237a 100644
--- a/libavformat/argo_brp.c
+++ b/libavformat/argo_brp.c
@@ -77,7 +77,7 @@ typedef struct ArgoBRPStreamHeader {
typedef struct ArgoBRPDemuxContext {
ArgoBRPFileHeader fhdr;
- ArgoBRPStreamHeader *streams;
+ ArgoBRPStreamHeader streams[BRP_MAX_STREAMS];
/* To know how much of a BASF to give. */
int64_t lastpts;
int hit_eof;
@@ -101,16 +101,6 @@ static int argo_brp_probe(const AVProbeData *p)
return AVPROBE_SCORE_EXTENSION + 1;
}
-static int argo_brp_read_close(AVFormatContext *s)
-{
- ArgoBRPDemuxContext *brp = s->priv_data;
-
- if (brp->streams != NULL)
- av_freep(&brp->streams);
-
- return 0;
-}
-
static int read_extradata(AVFormatContext *s, const ArgoBRPStreamHeader *hdr,
void *buf, size_t bufsz)
{
@@ -174,9 +164,6 @@ static int argo_brp_read_header(AVFormatContext *s)
return AVERROR_PATCHWELCOME;
}
- if ((brp->streams = av_mallocz_array(brp->fhdr.num_streams, sizeof(ArgoBRPStreamHeader))) == NULL)
- return AVERROR(ENOMEM);
-
/* Build the stream info. */
brp->basf.index = -1;
for (uint32_t i = 0; i < brp->fhdr.num_streams; i++) {
@@ -331,8 +318,6 @@ static int argo_brp_read_header(AVFormatContext *s)
return 0;
fail:
- /* TODO: Remove once AVFMT_HEADER_CLEANUP lands. */
- argo_brp_read_close(s);
return ret;
}
@@ -445,5 +430,4 @@ AVInputFormat ff_argo_brp_demuxer = {
.read_probe = argo_brp_probe,
.read_header = argo_brp_read_header,
.read_packet = argo_brp_read_packet,
- .read_close = argo_brp_read_close
};