summaryrefslogtreecommitdiffstats
path: root/sub/sd_ass.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-10-20 12:07:31 -0500
committerDudemanguy <random342@airmail.cc>2023-11-05 15:45:43 +0000
commit062104d16e34f348ffd9324ca4c997b6b0f487d4 (patch)
treeb6fdcdd14dca1a70329b6e98a9b90991dfbd6836 /sub/sd_ass.c
parent90170c1100cc9e085b13238e6e05177be1e1b30b (diff)
downloadmpv-062104d16e34f348ffd9324ca4c997b6b0f487d4.tar.bz2
mpv-062104d16e34f348ffd9324ca4c997b6b0f487d4.tar.xz
sub: redecode cached packets on UPDATE_SUB_HARD or UPDATE_SUB_FILT
UPDATE_SUB_HARD causes all of the ass objects to reset in order to apply the new style. UPDATE_SUB_FILT doesn't actually reset the sd, but it should in order to update the actual filters so that was added here. Doing this causes the current subtitle to be dropped. In the paused cause, this concidentally works because command.c forces a video refresh which then reloads the subtitle essentially. But while playing, the subtitle will be dropped and you won't get anything until the next one appears. Instead of using video refreshes, what we can do is just always save the last two subtitle packets in a cache and redecode them if needed. This is much easier and also allows us to get rid of all the video refresh logic in command.c. Fixes #12386.
Diffstat (limited to 'sub/sd_ass.c')
-rw-r--r--sub/sd_ass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index b24e228119..d3c220b5fe 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -859,12 +859,12 @@ static int control(struct sd *sd, enum sd_ctrl cmd, void *arg)
filters_destroy(sd);
filters_init(sd);
ctx->clear_once = true; // allow reloading on seeks
+ reset(sd);
}
if (flags & UPDATE_SUB_HARD) {
// ass_track will be recreated, so clear duplicate cache
ctx->clear_once = true;
reset(sd);
-
assobjects_destroy(sd);
assobjects_init(sd);
}