diff options
author | wm4 <wm4@nowhere> | 2015-10-12 21:56:44 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-10-12 23:01:32 +0200 |
commit | de4ea4bbd1c5101bf0b572a4facd58875845f495 (patch) | |
tree | c01bef70635acc11dcc10798bc86528e0d21c1ba /libass/ass.h | |
parent | 4778001b673c73133d7d1dd48a385d0ca424ccfc (diff) | |
download | libass-de4ea4bbd1c5101bf0b572a4facd58875845f495.tar.bz2 libass-de4ea4bbd1c5101bf0b572a4facd58875845f495.tar.xz |
ass: use a bitmap for checking duplicate events
The loop in check_duplicate_event() essentially makes event processing
with ass_process_chunk() O(n^2). Using a bitmap instead of a loop brings
it back to O(n).
This could be interpreted as an API change: since the event list is
freely modifieable by the API user through ASS_Track public fields,
libass can't know if the internal bitmap went out of sync with the
public event list. We just redefine it so that calling
ass_process_chunk() means the API user agrees not to manipulate the
event list otherwise.
Diffstat (limited to 'libass/ass.h')
-rw-r--r-- | libass/ass.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libass/ass.h b/libass/ass.h index c5d0936..cbcc9f0 100644 --- a/libass/ass.h +++ b/libass/ass.h @@ -24,7 +24,7 @@ #include <stdarg.h> #include "ass_types.h" -#define LIBASS_VERSION 0x01300000 +#define LIBASS_VERSION 0x01300001 #ifdef __cplusplus extern "C" { @@ -562,6 +562,10 @@ void ass_process_codec_private(ASS_Track *track, char *data, int size); /** * \brief Parse a chunk of subtitle stream data. A chunk contains exactly one * event in Matroska format. See the Matroska specification for details. + * In later libass versions (since LIBASS_VERSION==0x01300001), using this + * function means you agree not to modify events manually, or using other + * functions manipulating the event list like ass_process_data(). If you do + * anyway, the internal duplicate checking might break. * \param track track * \param data string to parse * \param size length of data |