Skip to content

Commit

Permalink
Remove unused parser
Browse files Browse the repository at this point in the history
Since 1c02b58, the parser is not used
anymore.
  • Loading branch information
rom1v committed Feb 10, 2023
1 parent 45b2e6d commit f03f322
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
14 changes: 1 addition & 13 deletions app/src/demuxer.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,10 @@ run_demuxer(void *data) {
goto end;
}

demuxer->parser = av_parser_init(codec_id);
if (!demuxer->parser) {
LOGE("Could not initialize parser");
goto finally_close_sinks;
}

// We must only pass complete frames to av_parser_parse2()!
// It's more complicated, but this allows to reduce the latency by 1 frame!
demuxer->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;

AVPacket *packet = av_packet_alloc();
if (!packet) {
LOG_OOM();
goto finally_close_parser;
goto finally_close_sinks;
}

for (;;) {
Expand All @@ -267,8 +257,6 @@ run_demuxer(void *data) {
}

av_packet_free(&packet);
finally_close_parser:
av_parser_close(demuxer->parser);
finally_close_sinks:
sc_demuxer_close_sinks(demuxer);
end:
Expand Down
1 change: 0 additions & 1 deletion app/src/demuxer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ struct sc_demuxer {
struct sc_packet_sink *sinks[SC_DEMUXER_MAX_SINKS];
unsigned sink_count;

AVCodecParserContext *parser;
// successive packets may need to be concatenated, until a non-config
// packet is available
AVPacket *pending;
Expand Down

0 comments on commit f03f322

Please sign in to comment.