summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authoraurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-09-05 15:07:06 +0000
committeraurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-09-05 15:07:06 +0000
commit81058d5af23507640036ffb061d3c42accd0b163 (patch)
tree8db26321c123f5c81bbace877c0b9369360e1ec1 /libass
parent79874cb4ea71182a5eaa7564d7cc16a16c3c987d (diff)
downloadmpv-81058d5af23507640036ffb061d3c42accd0b163.tar.bz2
mpv-81058d5af23507640036ffb061d3c42accd0b163.tar.xz
libass: add a new ass_process_data() to process demuxed subtitle packets
conforming to the ASS spec git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27530 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass')
-rw-r--r--libass/ass.c20
-rw-r--r--libass/ass.h8
2 files changed, 24 insertions, 4 deletions
diff --git a/libass/ass.c b/libass/ass.c
index 1ee81773b3..711d3c52af 100644
--- a/libass/ass.c
+++ b/libass/ass.c
@@ -717,21 +717,33 @@ static int process_text(ass_track_t* track, char* str)
}
/**
- * \brief Process CodecPrivate section of subtitle stream
+ * \brief Process a chunk of subtitle stream data.
* \param track track
* \param data string to parse
* \param size length of data
- CodecPrivate section contains [Stream Info] and [V4+ Styles] ([V4 Styles] for SSA) sections
-*/
-void ass_process_codec_private(ass_track_t* track, char *data, int size)
+*/
+void ass_process_data(ass_track_t* track, char* data, int size)
{
char* str = malloc(size + 1);
memcpy(str, data, size);
str[size] = '\0';
+ mp_msg(MSGT_ASS, MSGL_V, "event: %s\n", str);
process_text(track, str);
free(str);
+}
+
+/**
+ * \brief Process CodecPrivate section of subtitle stream
+ * \param track track
+ * \param data string to parse
+ * \param size length of data
+ CodecPrivate section contains [Stream Info] and [V4+ Styles] ([V4 Styles] for SSA) sections
+*/
+void ass_process_codec_private(ass_track_t* track, char *data, int size)
+{
+ ass_process_data(track, data, size);
if (!track->event_format) {
// probably an mkv produced by ancient mkvtoolnix
diff --git a/libass/ass.h b/libass/ass.h
index baa52ead0c..7eccbe9552 100644
--- a/libass/ass.h
+++ b/libass/ass.h
@@ -154,6 +154,14 @@ void ass_free_style(ass_track_t* track, int sid);
void ass_free_event(ass_track_t* track, int eid);
/**
+ * \brief Parse a chunk of subtitle stream data.
+ * \param track track
+ * \param data string to parse
+ * \param size length of data
+ */
+void ass_process_data(ass_track_t* track, char* data, int size);
+
+/**
* \brief Parse Codec Private section of subtitle stream
* \param track target track
* \param data string to parse