Browse Source

avcodec/decode: Return early upon failure

Allows to remove one level of indentation.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
tags/n4.4
Andreas Rheinhardt 5 years ago
parent
commit
684e501cb9
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      libavcodec/decode.c

+ 3
- 4
libavcodec/decode.c View File

@@ -1043,9 +1043,9 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
AVPacket pkt_recoded = *avpkt;

ret = recode_subtitle(avctx, &pkt_recoded, avpkt);
if (ret < 0) {
*got_sub_ptr = 0;
} else {
if (ret < 0)
return ret;
ret = extract_packet_props(avctx->internal, &pkt_recoded);
if (ret < 0)
return ret;
@@ -1099,7 +1099,6 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,

av_packet_unref(&pkt_recoded);
}
}

if (*got_sub_ptr)
avctx->frame_number++;


Loading…
Cancel
Save