diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c index a5121b6eb7..6b6345e2ef 100644 --- a/libavcodec/libaribcaption.c +++ b/libavcodec/libaribcaption.c @@ -346,19 +346,8 @@ static int aribcaption_trans_bitmap_subtitle(ARIBCaptionContext *ctx) return 0; case ARIBCC_RENDER_STATUS_NO_IMAGE: - ff_dlog(ctx, "no image\n"); - /* A caption carrying an explicit clear screen (CS) produces no - image. Report an empty subtitle so that the previously displayed - bitmap is erased; the TEXT path already does this by emitting "". - Do not treat every regionless caption as a clear: a statement - containing only TIME also decodes to zero regions but must not - erase the display. */ - if (ctx->caption.flags & ARIBCC_CAPTIONFLAGS_CLEARSCREEN) { - sub->format = 0; /* graphic */ - sub->num_rects = 0; - return 1; - } - return 0; + /* the result holds no image, handled below */ + break; case ARIBCC_RENDER_STATUS_ERROR: av_log(ctx, AV_LOG_ERROR, @@ -373,8 +362,14 @@ static int aribcaption_trans_bitmap_subtitle(ARIBCaptionContext *ctx) } if (!ctx->render_result.image_count || ctx->render_result.images == NULL) { - aribcc_render_result_cleanup(&ctx->render_result); ff_dlog(ctx, "no image (%d)\n", ctx->render_result.image_count); + aribcc_render_result_cleanup(&ctx->render_result); + /* A caption carrying an explicit clear screen (CS) may produce no + image. Report an empty subtitle so that the previously displayed + bitmap is erased; the TEXT path already does this by emitting "". + Do not treat every caption without image as a clear: a statement + containing only TIME also decodes to zero regions but must not + erase the display. */ if (ctx->caption.flags & ARIBCC_CAPTIONFLAGS_CLEARSCREEN) { sub->format = 0; /* graphic */ sub->num_rects = 0;