mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
deinterlace: Drain the field history if the caps are changing
Otherwise we will use fields from the old caps with everything set up for the new caps, causing crashes and worse. Also don't do anything if the same caps are set twice.
This commit is contained in:
parent
0c84b1b104
commit
1f21747cc5
1 changed files with 10 additions and 1 deletions
|
@ -2521,9 +2521,18 @@ gst_deinterlace_setcaps (GstDeinterlace * self, GstPad * pad, GstCaps * caps)
|
|||
GstCaps *srccaps = NULL;
|
||||
GstVideoInterlaceMode interlacing_mode;
|
||||
gint fps_n, fps_d;
|
||||
GstCaps *peercaps;
|
||||
GstCaps *peercaps, *current_caps;
|
||||
|
||||
gst_pad_check_reconfigure (self->srcpad);
|
||||
|
||||
if ((current_caps = gst_pad_get_current_caps (pad))) {
|
||||
if (gst_caps_is_equal (caps, current_caps)) {
|
||||
GST_DEBUG_OBJECT (pad, "Got same caps again, returning");
|
||||
gst_caps_unref (current_caps);
|
||||
return TRUE;
|
||||
}
|
||||
gst_deinterlace_reset_history (self, FALSE);
|
||||
}
|
||||
peercaps = gst_pad_peer_query_caps (self->srcpad, NULL);
|
||||
|
||||
/* Make sure the peer caps are compatible with the template caps */
|
||||
|
|
Loading…
Reference in a new issue