diff options
author | André Dieb Martins <andre.dieb@gmail.com> | 2010-04-04 20:31:38 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.co.uk> | 2010-04-04 21:30:06 -0300 |
commit | 74ac172bc20e1ae657484aeb37fbaf08ad2a2b28 (patch) | |
tree | b9c56b15ab0d592e444974ae52d5cf450e46ade2 /ext/jpeg/gstjpegenc.c | |
parent | b62d7815160a3150b26e16b1d8291c8bbb042b2d (diff) |
jpegenc: should not return caps ANY based on downstream
When downstream has a sink pad with ANY caps, jpegenc should
treat it the same as NULL and return its template caps.
Fixes #614842
Diffstat (limited to 'ext/jpeg/gstjpegenc.c')
-rw-r--r-- | ext/jpeg/gstjpegenc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c index 931f3a2b3..08a74677e 100644 --- a/ext/jpeg/gstjpegenc.c +++ b/ext/jpeg/gstjpegenc.c @@ -322,10 +322,15 @@ gst_jpegenc_getcaps (GstPad * pad) other end of the element */ caps = gst_pad_peer_get_caps (jpegenc->srcpad); - if (caps == NULL) + + if (caps == NULL) { + caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); + } else if (gst_caps_is_any (caps)) { + gst_caps_unref (caps); caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); - else + } else { caps = gst_caps_make_writable (caps); + } for (i = 0; i < gst_caps_get_size (caps); i++) { structure = gst_caps_get_structure (caps, i); |