mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-06 05:17:42 +00:00
avcodec/libaribcaption: keep the clear when ass mode skips every region as ruby
With ignore_ruby=1 and ass_single_rect=0, a caption whose regions are all ruby skips every region and returned no event, even when it carries a clear screen (CS). The previous caption then stayed on screen. The bitmap path and ass_single_rect=1 already erase it in that case. Emit the empty clear event in that case too. Such captions do occur in broadcasts: among 2293 captions from 40 recent Japanese TV recordings, 3 carried CS with only ruby regions. With this change, ignore_ruby=1 output gains exactly those 3 clear events, and output with the default options is unchanged for all 40 recordings. 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:
1 parent
2a759286a2
commit
ad5c00b0ce
1 file changed
+9
@@ -781,6 +781,15 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx)
|
||||
rect_idx++;
|
||||
}
|
||||
}
|
||||
if (!single_rect && !rect_idx) {
|
||||
/* Every region was skipped as ruby. A clear screen (CS) must still
|
||||
erase the previous caption. */
|
||||
av_bprint_finalize(&buf, NULL);
|
||||
if (!(ctx->caption.flags & ARIBCC_CAPTIONFLAGS_CLEARSCREEN))
|
||||
return 0;
|
||||
ret = ff_ass_add_rect(sub, "", ctx->readorder++, 0, NULL, NULL);
|
||||
return ret < 0 ? ret : 1;
|
||||
}
|
||||
if (single_rect) {
|
||||
if (!av_bprint_is_complete(&buf)) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
|
||||
Reference in new issue
Block a user