Commit 26d08125 authored by René Stadler's avatar René Stadler

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.
parent bf65acf1
...@@ -658,12 +658,18 @@ gst_matroska_mux_handle_sink_event (GstPad * pad, GstEvent * event) ...@@ -658,12 +658,18 @@ gst_matroska_mux_handle_sink_event (GstPad * pad, GstEvent * event)
event = NULL; event = NULL;
break; break;
} }
case GST_EVENT_NEWSEGMENT: case GST_EVENT_NEWSEGMENT:{
/* We don't support NEWSEGMENT events */ GstFormat format;
ret = FALSE;
gst_event_unref (event); gst_event_parse_new_segment (event, NULL, NULL, &format, NULL, NULL,
event = NULL; NULL);
if (format != GST_FORMAT_TIME) {
ret = FALSE;
gst_event_unref (event);
event = NULL;
}
break; break;
}
case GST_EVENT_CUSTOM_DOWNSTREAM:{ case GST_EVENT_CUSTOM_DOWNSTREAM:{
const GstStructure *structure; const GstStructure *structure;
...@@ -2491,6 +2497,10 @@ gst_matroska_mux_best_pad (GstMatroskaMux * mux, gboolean * popped) ...@@ -2491,6 +2497,10 @@ gst_matroska_mux_best_pad (GstMatroskaMux * mux, gboolean * popped)
collect_pad->buffer = NULL; collect_pad->buffer = NULL;
return NULL; return NULL;
} else { } 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 = collect_pad->buffer =
gst_buffer_make_metadata_writable (collect_pad->buffer); gst_buffer_make_metadata_writable (collect_pad->buffer);
GST_BUFFER_TIMESTAMP (collect_pad->buffer) = time; GST_BUFFER_TIMESTAMP (collect_pad->buffer) = time;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment