diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.co.uk> | 2011-02-12 13:48:03 +0200 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.co.uk> | 2011-02-12 13:48:03 +0200 |
commit | 7215e50ce9e3e98ba8acb2dfe052520a21972f35 (patch) | |
tree | 36577569e7c27b1d420de059adcea3cdec6ce220 /src/QGst/element.cpp | |
parent | 771aea1176625987b6e3038c222899a83ecbcbd5 (diff) |
Fix Element::unlink().
Unfortunately, gst_element_unlink_pads() does not accept NULL
for the pad names and I never actually checked it...
Diffstat (limited to 'src/QGst/element.cpp')
-rw-r--r-- | src/QGst/element.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/QGst/element.cpp b/src/QGst/element.cpp index 0a43b77..a41ff7a 100644 --- a/src/QGst/element.cpp +++ b/src/QGst/element.cpp @@ -124,12 +124,28 @@ bool Element::link(const ElementPtr & dest, const CapsPtr & filter) void Element::unlink(const char *srcPadName, const ElementPtr & dest, const char *sinkPadName) { + //FIXME-0.11 This is not entirely correct. Unfortunately I didn't notice + //that gst_element_unlink_pads requires both pad names when I wrote this + //function, and it cannot be changed now. For the moment, if the sink + //pad name is not given, we will assume it is "sink". + if (!sinkPadName) { + sinkPadName = "sink"; + } + gst_element_unlink_pads(object<GstElement>(), srcPadName, dest, sinkPadName); } void Element::unlink(const ElementPtr & dest, const char *sinkPadName) { - unlink(NULL, dest, sinkPadName); + if (sinkPadName) { + //FIXME-0.11 This is not entirely correct. Unfortunately I didn't notice + //that gst_element_unlink_pads requires both pad names when I wrote this + //function, and it cannot be changed now. For the moment, if the source + //pad name is not given, we will assume it is "src". + unlink("src", dest, sinkPadName); + } else { + gst_element_unlink(object<GstElement>(), dest); + } } bool Element::query(const QueryPtr & query) |