playsink: handle NULL ghost pad target
For the src pad anyway. https://bugzilla.gnome.org/show_bug.cgi?id=661262
This commit is contained in:
parent
a583b63722
commit
2b84b328b1
@ -352,17 +352,27 @@ gst_play_sink_audio_convert_getcaps (GstPad * pad)
|
|||||||
|
|
||||||
GST_PLAY_SINK_AUDIO_CONVERT_LOCK (self);
|
GST_PLAY_SINK_AUDIO_CONVERT_LOCK (self);
|
||||||
otherpad = gst_ghost_pad_get_target (GST_GHOST_PAD_CAST (pad));
|
otherpad = gst_ghost_pad_get_target (GST_GHOST_PAD_CAST (pad));
|
||||||
|
if (!otherpad) {
|
||||||
|
if (pad == self->srcpad) {
|
||||||
|
otherpad = self->sink_proxypad;
|
||||||
|
}
|
||||||
|
/* no equivalent for the sink pad */
|
||||||
|
}
|
||||||
GST_PLAY_SINK_AUDIO_CONVERT_UNLOCK (self);
|
GST_PLAY_SINK_AUDIO_CONVERT_UNLOCK (self);
|
||||||
|
|
||||||
peer = gst_pad_get_peer (otherpad);
|
if (otherpad) {
|
||||||
if (peer) {
|
peer = gst_pad_get_peer (otherpad);
|
||||||
ret = gst_pad_get_caps_reffed (peer);
|
if (peer) {
|
||||||
gst_object_unref (peer);
|
ret = gst_pad_get_caps_reffed (peer);
|
||||||
|
gst_object_unref (peer);
|
||||||
|
} else {
|
||||||
|
ret = gst_caps_new_any ();
|
||||||
|
}
|
||||||
|
gst_object_unref (otherpad);
|
||||||
} else {
|
} else {
|
||||||
|
GST_WARNING_OBJECT (self, "Could not traverse bin");
|
||||||
ret = gst_caps_new_any ();
|
ret = gst_caps_new_any ();
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_object_unref (otherpad);
|
|
||||||
gst_object_unref (self);
|
gst_object_unref (self);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -332,17 +332,28 @@ gst_play_sink_video_convert_getcaps (GstPad * pad)
|
|||||||
|
|
||||||
GST_PLAY_SINK_VIDEO_CONVERT_LOCK (self);
|
GST_PLAY_SINK_VIDEO_CONVERT_LOCK (self);
|
||||||
otherpad = gst_ghost_pad_get_target (GST_GHOST_PAD_CAST (pad));
|
otherpad = gst_ghost_pad_get_target (GST_GHOST_PAD_CAST (pad));
|
||||||
|
if (!otherpad) {
|
||||||
|
if (pad == self->srcpad) {
|
||||||
|
otherpad = self->sink_proxypad;
|
||||||
|
}
|
||||||
|
/* no equivalent for the sink pad */
|
||||||
|
}
|
||||||
GST_PLAY_SINK_VIDEO_CONVERT_UNLOCK (self);
|
GST_PLAY_SINK_VIDEO_CONVERT_UNLOCK (self);
|
||||||
|
|
||||||
peer = gst_pad_get_peer (otherpad);
|
if (otherpad) {
|
||||||
if (peer) {
|
peer = gst_pad_get_peer (otherpad);
|
||||||
ret = gst_pad_get_caps_reffed (peer);
|
if (peer) {
|
||||||
gst_object_unref (peer);
|
ret = gst_pad_get_caps_reffed (peer);
|
||||||
|
gst_object_unref (peer);
|
||||||
|
} else {
|
||||||
|
ret = gst_caps_new_any ();
|
||||||
|
}
|
||||||
|
gst_object_unref (otherpad);
|
||||||
} else {
|
} else {
|
||||||
|
GST_WARNING_OBJECT (self, "Could not traverse bin");
|
||||||
ret = gst_caps_new_any ();
|
ret = gst_caps_new_any ();
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_object_unref (otherpad);
|
|
||||||
gst_object_unref (self);
|
gst_object_unref (self);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user