avcodec/libaribcaption: share the bitmap no-image path

ARIBCC_RENDER_STATUS_NO_IMAGE leaves the render result empty, so it
reaches the same "no image" check as a GOT_IMAGE result without images.
Let it fall through instead of keeping a second copy of the clear
handling, and log the image count before the result is cleaned up,
which reset it to 0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DdDiDRusmi6eD7qSrKBjHb
This commit is contained in:
Ruk DoeandClaude Opus 5.5 authored and michaelni committed 2026-11-06 04:39:07 +00:00
1 parent 164df82147
commit 17efc4766b
1 file changed
+9 -14
+9 -14
View File
@@ -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;