Original commit message from CVS:
* gst/subparse/gstsubparse.c: (feed_textbuf):
Fix detection of discontinuities based on the buffer offset (doesn't work
so well if no buffer offset is set) and also check for the DISCONT buffer
flag. This keeps the parser state from being reset after each buffer in
the unit test.
2008-05-03 Tim-Philipp Müller <tim.muller at collabora co uk>
2008-05-03 Tim-Philipp Müller <tim.muller at collabora co uk>
+ * gst/subparse/gstsubparse.c: (feed_textbuf):
+ Fix detection of discontinuities based on the buffer offset (doesn't work
+ so well if no buffer offset is set) and also check for the DISCONT buffer
+ flag. This keeps the parser state from being reset after each buffer in
+ the unit test.
+
+2008-05-03 Tim-Philipp Müller <tim.muller at collabora co uk>
+
* gst/typefind/gsttypefindfunctions.c: (mpeg_video_stream_type_find):
Further fine-tuning: don't absolutely require sequence or GOP headers
(as introduced in the previous commit), but adjust the typefind
* gst/typefind/gsttypefindfunctions.c: (mpeg_video_stream_type_find):
Further fine-tuning: don't absolutely require sequence or GOP headers
(as introduced in the previous commit), but adjust the typefind
static void
feed_textbuf (GstSubParse * self, GstBuffer * buf)
{
static void
feed_textbuf (GstSubParse * self, GstBuffer * buf)
{
- if (GST_BUFFER_OFFSET (buf) != self->offset) {
+ gboolean discont;
+
+ discont = GST_BUFFER_IS_DISCONT (buf);
+
+ if (GST_BUFFER_OFFSET_IS_VALID (buf) &&
+ GST_BUFFER_OFFSET (buf) != self->offset) {
+ self->offset = GST_BUFFER_OFFSET (buf);
+ discont = TRUE;
+ }
+
+ if (discont) {
+ GST_INFO ("discontinuity");
/* flush the parser state */
parser_state_init (&self->state);
g_string_truncate (self->textbuf, 0);
sami_context_reset (&self->state);
/* flush the parser state */
parser_state_init (&self->state);
g_string_truncate (self->textbuf, 0);
sami_context_reset (&self->state);
+ /* we could set a flag to make sure that the next buffer we push out also
+ * has the DISCONT flag set, but there's no point really given that it's
+ * subtitles which are discontinuous by nature. */
}
self->textbuf = g_string_append_len (self->textbuf,
}
self->textbuf = g_string_append_len (self->textbuf,