|
|
@ -170,19 +170,24 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, |
|
|
|
ParseContext *pc = &s->pc; |
|
|
|
ParseContext *pc = &s->pc; |
|
|
|
int next, header_len; |
|
|
|
int next, header_len; |
|
|
|
|
|
|
|
|
|
|
|
next = opus_find_frame_end(ctx, avctx, buf, buf_size, &header_len); |
|
|
|
if (ctx->flags & PARSER_FLAG_COMPLETE_FRAMES) { |
|
|
|
|
|
|
|
next = buf_size; |
|
|
|
if (s->ts_framing && next != AVERROR_INVALIDDATA && |
|
|
|
header_len = 0; |
|
|
|
ff_combine_frame(pc, next, &buf, &buf_size) < 0) { |
|
|
|
} else { |
|
|
|
*poutbuf = NULL; |
|
|
|
next = opus_find_frame_end(ctx, avctx, buf, buf_size, &header_len); |
|
|
|
*poutbuf_size = 0; |
|
|
|
|
|
|
|
return buf_size; |
|
|
|
if (s->ts_framing && next != AVERROR_INVALIDDATA && |
|
|
|
} |
|
|
|
ff_combine_frame(pc, next, &buf, &buf_size) < 0) { |
|
|
|
|
|
|
|
*poutbuf = NULL; |
|
|
|
|
|
|
|
*poutbuf_size = 0; |
|
|
|
|
|
|
|
return buf_size; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (next == AVERROR_INVALIDDATA){ |
|
|
|
if (next == AVERROR_INVALIDDATA){ |
|
|
|
*poutbuf = NULL; |
|
|
|
*poutbuf = NULL; |
|
|
|
*poutbuf_size = 0; |
|
|
|
*poutbuf_size = 0; |
|
|
|
return buf_size; |
|
|
|
return buf_size; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
*poutbuf = buf + header_len; |
|
|
|
*poutbuf = buf + header_len; |
|
|
|