summaryrefslogtreecommitdiffstats
path: root/sub/dec_sub.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-16 01:02:17 +0100
committerwm4 <wm4@nowhere>2020-02-16 02:07:24 +0100
commit0b35b4c91796fb020e13d955efd450021eb5eedb (patch)
tree2223d7c7f32afc60efb12b0051343e99e6bf727b /sub/dec_sub.h
parente162bcb5a09b5ad514636684314e8e797ab2a47b (diff)
downloadmpv-0b35b4c91796fb020e13d955efd450021eb5eedb.tar.bz2
mpv-0b35b4c91796fb020e13d955efd450021eb5eedb.tar.xz
sub: make filter_sdh a "proper" filter, allow runtime changes
Until now, filter_sdh was simply a function that was called by sd_ass directly (if enabled). I want to add another filter, so it's time to turn this into a somewhat more general subtitle filtering infrastructure. I pondered whether to reuse the audio/video filtering stuff - but better not. Also, since subtitles are horrible and tend to refuse proper abstraction, it's still messed into sd_ass, instead of working on the dec_sub.c level. Actually mpv used to have subtitle "filters" and even made subtitle converters part of it, but it was fairly horrible, so don't do that again. In addition, make runtime changes possible. Since this was supposed to be a quick hack, I just decided to put all subtitle filter options into a separate option group (=> simpler change notification), to manually push the change through the playloop (like it was sort of before for OSD options), and to recreate the sub filter chain completely in every change. Should be good enough. One strangeness is that due to prefetching and such, most subtitle packets (or those some time ahead) are actually done filtering when we change, so the user still needs to manually seek to actually refresh everything. And since subtitle data is usually cached in ASS_Track (for other terrible but user-friendly reasons), we also must clear the subtitle data, but of course only on seek, since otherwise all subtitles would just disappear. What a fucking mess, but such is life. We could trigger a "refresh seek" to make this more automatic, but I don't feel like it currently. This is slightly inefficient (lots of allocations and copying), but I decided that it doesn't matter. Could matter slightly for crazy ASS subtitles that render with thousands of events. Not very well tested. Still seems to work, but I didn't have many test cases.
Diffstat (limited to 'sub/dec_sub.h')
-rw-r--r--sub/dec_sub.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sub/dec_sub.h b/sub/dec_sub.h
index 5449b97ad0..030b8d21e1 100644
--- a/sub/dec_sub.h
+++ b/sub/dec_sub.h
@@ -19,6 +19,7 @@ enum sd_ctrl {
SD_CTRL_SET_VIDEO_PARAMS,
SD_CTRL_SET_TOP,
SD_CTRL_SET_VIDEO_DEF_FPS,
+ SD_CTRL_UPDATE_OPTS,
};
struct sd_times {
@@ -46,7 +47,6 @@ char *sub_get_text(struct dec_sub *sub, double pts);
struct sd_times sub_get_times(struct dec_sub *sub, double pts);
void sub_reset(struct dec_sub *sub);
void sub_select(struct dec_sub *sub, bool selected);
-void sub_update_opts(struct dec_sub *sub);
void sub_set_recorder_sink(struct dec_sub *sub, struct mp_recorder_sink *sink);
void sub_set_play_dir(struct dec_sub *sub, int dir);