avformat/utils: Move ff_get_extradata to demux_utils.c

It is only used by demuxers (although it is hypothetically
possible that some day e.g. a protocol might need it, but
that is unlikely given that they don't deal with AVCodecParameters).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2022-05-06 21:28:57 +02:00
parent aef16886dd
commit a085cfa654
23 changed files with 45 additions and 28 deletions

View File

@@ -359,22 +359,6 @@ int ff_alloc_extradata(AVCodecParameters *par, int size)
return 0;
}
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size)
{
int ret = ff_alloc_extradata(par, size);
if (ret < 0)
return ret;
ret = ffio_read_size(pb, par->extradata, size);
if (ret < 0) {
av_freep(&par->extradata);
par->extradata_size = 0;
av_log(logctx, AV_LOG_ERROR, "Failed to read extradata of size %d\n", size);
return ret;
}
return ret;
}
AVProgram *av_find_program_from_stream(AVFormatContext *ic, AVProgram *last, int s)
{
for (unsigned i = 0; i < ic->nb_programs; i++) {