You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/opus/parser: remove duplicate failure path code
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@ -179,9 +179,7 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx,
|
|||||||
if (avctx->extradata && !s->extradata_parsed) {
|
if (avctx->extradata && !s->extradata_parsed) {
|
||||||
if (ff_opus_parse_extradata(avctx, &s->ctx) < 0) {
|
if (ff_opus_parse_extradata(avctx, &s->ctx) < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Error parsing Ogg extradata.\n");
|
av_log(avctx, AV_LOG_ERROR, "Error parsing Ogg extradata.\n");
|
||||||
*poutbuf = NULL;
|
goto fail;
|
||||||
*poutbuf_size = 0;
|
|
||||||
return buf_size;
|
|
||||||
}
|
}
|
||||||
av_freep(&s->ctx.channel_maps);
|
av_freep(&s->ctx.channel_maps);
|
||||||
s->extradata_parsed = 1;
|
s->extradata_parsed = 1;
|
||||||
@ -190,31 +188,29 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx,
|
|||||||
if (ctx->flags & PARSER_FLAG_COMPLETE_FRAMES) {
|
if (ctx->flags & PARSER_FLAG_COMPLETE_FRAMES) {
|
||||||
next = buf_size;
|
next = buf_size;
|
||||||
|
|
||||||
if (set_frame_duration(ctx, avctx, buf, buf_size) < 0) {
|
if (set_frame_duration(ctx, avctx, buf, buf_size) < 0)
|
||||||
*poutbuf = NULL;
|
goto fail;
|
||||||
*poutbuf_size = 0;
|
|
||||||
return buf_size;
|
|
||||||
}
|
|
||||||
} else {
|
} 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 &&
|
||||||
ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
|
ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
|
||||||
*poutbuf = NULL;
|
goto fail;
|
||||||
*poutbuf_size = 0;
|
|
||||||
return buf_size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next == AVERROR_INVALIDDATA){
|
if (next == AVERROR_INVALIDDATA){
|
||||||
*poutbuf = NULL;
|
goto fail;
|
||||||
*poutbuf_size = 0;
|
|
||||||
return buf_size;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*poutbuf = buf + header_len;
|
*poutbuf = buf + header_len;
|
||||||
*poutbuf_size = buf_size - header_len;
|
*poutbuf_size = buf_size - header_len;
|
||||||
return next;
|
return next;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
*poutbuf = NULL;
|
||||||
|
*poutbuf_size = 0;
|
||||||
|
return buf_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AVCodecParser ff_opus_parser = {
|
const AVCodecParser ff_opus_parser = {
|
||||||
|
Reference in New Issue
Block a user