if (strstr (srcName, "fakesouphttpsrc") == srcName &&
old_state == GST_STATE_PLAYING && new_state == GST_STATE_PAUSED) {
GList *pads = GST_ELEMENT_PADS (msg->src);
+ GstObject *srcBin;
/* src is a fake http src element. It should have only 1 pad */
fail_unless (pads != NULL);
fail_unless (g_list_length (pads) == 1);
+ /* fakeHTTPsrc element is placed inside a bin. Get the bin */
+ srcBin = gst_object_get_parent (msg->src);
+
+ /* the bin should have only 1 output pad */
+ pads = GST_ELEMENT_PADS (srcBin);
+ fail_unless (pads != NULL);
+ fail_unless (g_list_length (pads) == 1);
+
internalPad = gst_pad_get_peer (GST_PAD (pads->data));
testOutputStreamData = getTestOutputDataByPad (testData, internalPad);
gst_object_unref (internalPad);
}
g_mutex_unlock (&testData->scratchData->seekTaskStateLock);
}
+ gst_object_unref (srcBin);
}
}
checkDataReceived (testData, testOutputStreamData, buffer);
if (testOutputStreamData->scratchData->segmentReceivedSize > 2000) {
- GstPad *fakeHttpSrcPad;
- GstObject *fakeHttpSrcElement;
+ GstPad *srcBinPad;
+ GstObject *srcBin;
+ GstElement *fakeHttpSrcElement;
- /* tell fake soup http src to post an error on the adaptive demux bus */
- fakeHttpSrcPad =
+ srcBinPad =
gst_pad_get_peer (testOutputStreamData->scratchData->internalPad);
- fakeHttpSrcElement = gst_pad_get_parent (fakeHttpSrcPad);
+ srcBin = gst_pad_get_parent (srcBinPad);
+
+ fakeHttpSrcElement = gst_bin_get_by_interface (GST_BIN (srcBin),
+ GST_TYPE_URI_HANDLER);
+ /* tell fake soup http src to post an error on the adaptive demux bus */
gst_fake_soup_http_src_simulate_download_error ((GstFakeSoupHTTPSrc *)
fakeHttpSrcElement, 404);
- gst_object_unref (fakeHttpSrcPad);
+ gst_object_unref (srcBinPad);
+ gst_object_unref (srcBin);
gst_object_unref (fakeHttpSrcElement);
testData->expectError = TRUE;