gst_element_add_pad (GST_ELEMENT_CAST (wavparse), wavparse->srcpad);
}
-static void
-gst_wavparse_destroy_sourcepad (GstWavParse * wavparse)
-{
- if (wavparse->srcpad) {
- gst_element_remove_pad (GST_ELEMENT_CAST (wavparse), wavparse->srcpad);
- wavparse->srcpad = NULL;
- }
-}
-
/* Compute (value * nom) % denom, avoiding overflow. This can be used
* to perform ceiling or rounding division together with
* gst_util_uint64_scale[_int]. */
* as it completes one iteration (and thus might block when the sink is
* blocking in preroll). */
if (flush) {
- if (wav->srcpad) {
- GST_DEBUG_OBJECT (wav, "sending flush start");
- gst_pad_push_event (wav->srcpad, gst_event_new_flush_start ());
- }
+ GST_DEBUG_OBJECT (wav, "sending flush start");
+ gst_pad_push_event (wav->srcpad, gst_event_new_flush_start ());
} else {
gst_pad_pause_task (wav->sinkpad);
}
wav->end_offset, GST_TIME_ARGS (seeksegment.start), GST_TIME_ARGS (stop));
/* prepare for streaming again */
- if (wav->srcpad) {
- if (flush) {
- /* if we sent a FLUSH_START, we now send a FLUSH_STOP */
- GST_DEBUG_OBJECT (wav, "sending flush stop");
- gst_pad_push_event (wav->srcpad, gst_event_new_flush_stop (TRUE));
- }
+ if (flush) {
+ /* if we sent a FLUSH_START, we now send a FLUSH_STOP */
+ GST_DEBUG_OBJECT (wav, "sending flush stop");
+ gst_pad_push_event (wav->srcpad, gst_event_new_flush_stop (TRUE));
}
/* now we did the seek and can activate the new segment values */
gst_message_new_segment_done (GST_OBJECT_CAST (wav),
wav->segment.format, stop));
} else {
- if (wav->srcpad != NULL)
- gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
+ gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
}
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
/* for fatal errors we post an error message, post the error
GST_ELEMENT_ERROR (wav, STREAM, FAILED,
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)", reason, ret));
- if (wav->srcpad != NULL)
- gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
+ gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
}
return;
}
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- gst_wavparse_destroy_sourcepad (wav);
gst_wavparse_reset (wav);
break;
case GST_STATE_CHANGE_READY_TO_NULL: