[FFmpeg-cvslog] avcodec/ccaption_dec: simplify init function

Paul B Mahol git at videolan.org
Sat May 20 14:01:01 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat May 20 11:44:47 2023 +0200| [8980c1313b23004b1789d01ba8be423d175fd8a8] | committer: Paul B Mahol

avcodec/ccaption_dec: simplify init function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8980c1313b23004b1789d01ba8be423d175fd8a8
---

 libavcodec/ccaption_dec.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 0f5b955f15..f91c92b373 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -262,7 +262,6 @@ typedef struct CCaptionSubContext {
 
 static av_cold int init_decoder(AVCodecContext *avctx)
 {
-    int ret;
     CCaptionSubContext *ctx = avctx->priv_data;
 
     av_bprint_init(&ctx->buffer[0], 0, AV_BPRINT_SIZE_UNLIMITED);
@@ -272,7 +271,7 @@ static av_cold int init_decoder(AVCodecContext *avctx)
     ctx->bg_color = CCCOL_BLACK;
     ctx->rollup = 2;
     ctx->cursor_row = 10;
-    ret = ff_ass_subtitle_header(avctx, "Monospace",
+    return ff_ass_subtitle_header(avctx, "Monospace",
                                  ASS_DEFAULT_FONT_SIZE,
                                  ASS_DEFAULT_COLOR,
                                  ASS_DEFAULT_BACK_COLOR,
@@ -281,11 +280,6 @@ static av_cold int init_decoder(AVCodecContext *avctx)
                                  ASS_DEFAULT_UNDERLINE,
                                  3,
                                  ASS_DEFAULT_ALIGNMENT);
-    if (ret < 0) {
-        return ret;
-    }
-
-    return ret;
 }
 
 static av_cold int close_decoder(AVCodecContext *avctx)



More information about the ffmpeg-cvslog mailing list