Remove unused codec context

The demuxer does not need any codec context.
This commit is contained in:
Romain Vimont 2023-02-10 18:45:31 +01:00
parent 6524e90c68
commit bd56c0abf7
2 changed files with 1 additions and 10 deletions

View file

@ -208,15 +208,9 @@ run_demuxer(void *data) {
goto end;
}
demuxer->codec_ctx = avcodec_alloc_context3(codec);
if (!demuxer->codec_ctx) {
LOG_OOM();
goto end;
}
if (!sc_demuxer_open_sinks(demuxer, codec)) {
LOGE("Could not open demuxer sinks");
goto finally_free_codec_ctx;
goto end;
}
demuxer->parser = av_parser_init(codec_id);
@ -261,8 +255,6 @@ finally_close_parser:
av_parser_close(demuxer->parser);
finally_close_sinks:
sc_demuxer_close_sinks(demuxer);
finally_free_codec_ctx:
avcodec_free_context(&demuxer->codec_ctx);
end:
demuxer->cbs->on_eos(demuxer, demuxer->cbs_userdata);

View file

@ -21,7 +21,6 @@ struct sc_demuxer {
struct sc_packet_sink *sinks[SC_DEMUXER_MAX_SINKS];
unsigned sink_count;
AVCodecContext *codec_ctx;
AVCodecParserContext *parser;
// successive packets may need to be concatenated, until a non-config
// packet is available