matroskamux: fix segment handling, so we actually use running time

gst_matroska_mux_best_pad adjusts the buffer timestamp to running time using
the segment stored in the pad's collect data. However, the event handler didn't
pass the newsegment event on to collectpads' handler, so this segment was never
updated at all.

Re-fixes bug #432612.
This commit is contained in:
René Stadler 2011-10-11 14:58:43 +02:00
parent bf65acf11f
commit 26d0812543

View file

@ -658,12 +658,18 @@ gst_matroska_mux_handle_sink_event (GstPad * pad, GstEvent * event)
event = NULL;
break;
}
case GST_EVENT_NEWSEGMENT:
/* We don't support NEWSEGMENT events */
ret = FALSE;
gst_event_unref (event);
event = NULL;
case GST_EVENT_NEWSEGMENT:{
GstFormat format;
gst_event_parse_new_segment (event, NULL, NULL, &format, NULL, NULL,
NULL);
if (format != GST_FORMAT_TIME) {
ret = FALSE;
gst_event_unref (event);
event = NULL;
}
break;
}
case GST_EVENT_CUSTOM_DOWNSTREAM:{
const GstStructure *structure;
@ -2491,6 +2497,10 @@ gst_matroska_mux_best_pad (GstMatroskaMux * mux, gboolean * popped)
collect_pad->buffer = NULL;
return NULL;
} else {
GST_LOG_OBJECT (mux, "buffer ts %" GST_TIME_FORMAT " -> %"
GST_TIME_FORMAT " running time",
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (collect_pad->buffer)),
GST_TIME_ARGS (time));
collect_pad->buffer =
gst_buffer_make_metadata_writable (collect_pad->buffer);
GST_BUFFER_TIMESTAMP (collect_pad->buffer) = time;