mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
v4l2videodec: Protect double calls to set_format()
In some cases, set_format() may get called twice before the output format is set. Running an allocation query in this case is both not needed and will cause assertion due tot he NULL caps.
This commit is contained in:
parent
57be4d2da3
commit
c87f9eb37b
1 changed files with 6 additions and 4 deletions
|
@ -260,10 +260,12 @@ gst_v4l2_video_dec_set_format (GstVideoDecoder * decoder,
|
|||
* block. */
|
||||
{
|
||||
GstCaps *caps = gst_pad_get_current_caps (decoder->srcpad);
|
||||
GstQuery *query = gst_query_new_allocation (caps, FALSE);
|
||||
gst_pad_peer_query (decoder->srcpad, query);
|
||||
gst_query_unref (query);
|
||||
gst_caps_unref (caps);
|
||||
if (caps) {
|
||||
GstQuery *query = gst_query_new_allocation (caps, FALSE);
|
||||
gst_pad_peer_query (decoder->srcpad, query);
|
||||
gst_query_unref (query);
|
||||
gst_caps_unref (caps);
|
||||
}
|
||||
}
|
||||
|
||||
gst_v4l2_object_stop (self->v4l2capture);
|
||||
|
|
Loading…
Reference in a new issue