mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
assrender: Keep track of the subtitle segments
This commit is contained in:
parent
06a79e9263
commit
8feed39593
2 changed files with 25 additions and 2 deletions
|
@ -764,8 +764,30 @@ gst_assrender_event_text (GstPad * pad, GstEvent * event)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_NEWSEGMENT:
|
||||
{
|
||||
gst_event_unref (event);
|
||||
ret = TRUE;
|
||||
GstFormat format;
|
||||
gdouble rate;
|
||||
gint64 start, stop, time;
|
||||
gboolean update;
|
||||
|
||||
GST_DEBUG_OBJECT (render, "received new segment");
|
||||
|
||||
gst_event_parse_new_segment (event, &update, &rate, &format, &start,
|
||||
&stop, &time);
|
||||
|
||||
if (format == GST_FORMAT_TIME) {
|
||||
GST_DEBUG_OBJECT (render, "SUBTITLE SEGMENT now: %" GST_SEGMENT_FORMAT,
|
||||
&render->subtitle_segment);
|
||||
|
||||
gst_segment_set_newsegment (&render->subtitle_segment, update, rate,
|
||||
format, start, stop, time);
|
||||
ret = TRUE;
|
||||
gst_event_unref (event);
|
||||
} else {
|
||||
GST_ELEMENT_WARNING (render, STREAM, MUX, (NULL),
|
||||
("received non-TIME newsegment event on subtitle input"));
|
||||
ret = FALSE;
|
||||
gst_event_unref (event);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
|
|
|
@ -56,6 +56,7 @@ struct _Gstassrender
|
|||
GCond *subtitle_cond;
|
||||
GstBuffer *subtitle_pending;
|
||||
gboolean subtitle_flushing;
|
||||
GstSegment subtitle_segment;
|
||||
|
||||
ASS_Library *ass_library;
|
||||
ASS_Renderer *ass_renderer;
|
||||
|
|
Loading…
Reference in a new issue