]> granicus.if.org Git - libass/commitdiff
libass: add a new ass_process_data() to process demuxed subtitle packets
authoraurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2>
Fri, 5 Sep 2008 15:07:06 +0000 (15:07 +0000)
committeraurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2>
Fri, 5 Sep 2008 15:07:06 +0000 (15:07 +0000)
conforming to the ASS spec

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27530 b3059339-0415-0410-9bf9-f77b7e298cf2

libass/ass.c
libass/ass.h

index 1ee81773b3ca2d0646c2dda026fc042d072d73c9..711d3c52af85d016f15c4d57b7f6fbc2051f6bbd 100644 (file)
@@ -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
index baa52ead0cbca4c9f25ccb7031618a0fb07fd822..7eccbe955234333b5a07e1a562605ad607735e85 100644 (file)
@@ -153,6 +153,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