Skip to content
Snippets Groups Projects
Commit 29878c56 authored by Thibault Saunier's avatar Thibault Saunier
Browse files

matroskamux: Do caps renegotiation when it only adds fields

Matroskamux can accept caps renegotiation if the new caps is a
superset of the old one, meaning upstream added new info to
the caps.

Same logic as a5f22f03aa25b04726f78ae619f40b3b648f7d48 in qtmux.
parent 2959bb18
No related branches found
No related tags found
No related merge requests found
...@@ -981,9 +981,10 @@ gst_matroska_mux_video_pad_setcaps (GstPad * pad, GstCaps * caps) ...@@ -981,9 +981,10 @@ gst_matroska_mux_video_pad_setcaps (GstPad * pad, GstCaps * caps)
if ((old_caps = gst_pad_get_current_caps (pad))) { if ((old_caps = gst_pad_get_current_caps (pad))) {
if (mux->state >= GST_MATROSKA_MUX_STATE_HEADER if (mux->state >= GST_MATROSKA_MUX_STATE_HEADER
&& !gst_caps_is_equal (caps, old_caps)) { && !gst_caps_is_subset (caps, old_caps)) {
GST_ELEMENT_ERROR (mux, STREAM, MUX, (NULL), GST_ELEMENT_ERROR (mux, STREAM, MUX, (NULL),
("Caps changed are not supported by Matroska")); ("Caps changes are not supported by Matroska\nCurrent: `%"
GST_PTR_FORMAT "`\nNew: `%" GST_PTR_FORMAT "`", old_caps, caps));
gst_caps_unref (old_caps); gst_caps_unref (old_caps);
goto refuse_caps; goto refuse_caps;
} }
...@@ -2479,7 +2480,7 @@ gst_matroska_mux_release_pad (GstElement * element, GstPad * pad) ...@@ -2479,7 +2480,7 @@ gst_matroska_mux_release_pad (GstElement * element, GstPad * pad)
if (cdata->pad == pad) { if (cdata->pad == pad) {
/* /*
* observed duration, this will remain GST_CLOCK_TIME_NONE * observed duration, this will remain GST_CLOCK_TIME_NONE
* only if the pad is resetted * only if the pad is resetted
*/ */
GstClockTime collected_duration = GST_CLOCK_TIME_NONE; GstClockTime collected_duration = GST_CLOCK_TIME_NONE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment