Commit 7e0df591 authored by Jacob Trimble's avatar Jacob Trimble Committed by James Almer

avcodec/opus_parser: Handle complete frames flag.

Signed-off-by: 's avatarJacob Trimble <modmaker@google.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 955a9893
...@@ -170,6 +170,10 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, ...@@ -170,6 +170,10 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx,
ParseContext *pc = &s->pc; ParseContext *pc = &s->pc;
int next, header_len; int next, header_len;
if (ctx->flags & PARSER_FLAG_COMPLETE_FRAMES) {
next = buf_size;
header_len = 0;
} else {
next = opus_find_frame_end(ctx, avctx, buf, buf_size, &header_len); next = opus_find_frame_end(ctx, avctx, buf, buf_size, &header_len);
if (s->ts_framing && next != AVERROR_INVALIDDATA && if (s->ts_framing && next != AVERROR_INVALIDDATA &&
...@@ -184,6 +188,7 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, ...@@ -184,6 +188,7 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx,
*poutbuf_size = 0; *poutbuf_size = 0;
return buf_size; return buf_size;
} }
}
*poutbuf = buf + header_len; *poutbuf = buf + header_len;
*poutbuf_size = buf_size - header_len; *poutbuf_size = buf_size - header_len;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment