parent
45b2e6db5c
commit
f03f32267e
2 changed files with 1 additions and 14 deletions
|
@ -228,20 +228,10 @@ run_demuxer(void *data) {
|
||||||
goto end;
|
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();
|
AVPacket *packet = av_packet_alloc();
|
||||||
if (!packet) {
|
if (!packet) {
|
||||||
LOG_OOM();
|
LOG_OOM();
|
||||||
goto finally_close_parser;
|
goto finally_close_sinks;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -267,8 +257,6 @@ run_demuxer(void *data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
av_packet_free(&packet);
|
av_packet_free(&packet);
|
||||||
finally_close_parser:
|
|
||||||
av_parser_close(demuxer->parser);
|
|
||||||
finally_close_sinks:
|
finally_close_sinks:
|
||||||
sc_demuxer_close_sinks(demuxer);
|
sc_demuxer_close_sinks(demuxer);
|
||||||
end:
|
end:
|
||||||
|
|
|
@ -21,7 +21,6 @@ struct sc_demuxer {
|
||||||
struct sc_packet_sink *sinks[SC_DEMUXER_MAX_SINKS];
|
struct sc_packet_sink *sinks[SC_DEMUXER_MAX_SINKS];
|
||||||
unsigned sink_count;
|
unsigned sink_count;
|
||||||
|
|
||||||
AVCodecParserContext *parser;
|
|
||||||
// successive packets may need to be concatenated, until a non-config
|
// successive packets may need to be concatenated, until a non-config
|
||||||
// packet is available
|
// packet is available
|
||||||
AVPacket *pending;
|
AVPacket *pending;
|
||||||
|
|
Loading…
Reference in a new issue