summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2004-07-28 09:36:10 +0000
committerWim Taymans <wim.taymans@gmail.com>2004-07-28 09:36:10 +0000
commit77ec1207d3d5d6e4bc8a29a735234b0ef217ae19 (patch)
treef4b37c2db44abf9a3feae40deab29eb3b21e05a1 /gst
parent9dd4541616546c59571ffe2b95131387a165a438 (diff)
gst/wavparse/gstwavparse.c: Add the pad to the element after setting up the caps. This makes it a lot easier to autop...
Original commit message from CVS: * gst/wavparse/gstwavparse.c: (gst_wavparse_fmt), (gst_wavparse_handle_seek), (gst_wavparse_srcpad_event): Add the pad to the element after setting up the caps. This makes it a lot easier to autoplug.
Diffstat (limited to 'gst')
-rw-r--r--gst/wavparse/gstwavparse.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c
index 2b17adc0..e231feb6 100644
--- a/gst/wavparse/gstwavparse.c
+++ b/gst/wavparse/gstwavparse.c
@@ -542,8 +542,6 @@ gst_wavparse_fmt (GstWavParse * wav)
wav->depth = header->size;
wav->bps = header->av_bps;
- gst_element_add_pad (GST_ELEMENT (wav), wav->srcpad);
-
caps = gst_riff_create_audio_caps (header->format, NULL, header, NULL);
if (caps) {
@@ -551,6 +549,8 @@ gst_wavparse_fmt (GstWavParse * wav)
gst_caps_free (caps);
}
+ gst_element_add_pad (GST_ELEMENT (wav), wav->srcpad);
+
GST_DEBUG ("frequency %d, channels %d", wav->rate, wav->channels);
return TRUE;
@@ -617,7 +617,6 @@ gst_wavparse_other (GstWavParse * wav)
static gboolean
gst_wavparse_handle_seek (GstWavParse * wav)
{
-#if 1
GstRiffRead *riff = GST_RIFF_READ (wav);
GstEvent *event = NULL;
guint32 remaining;
@@ -660,9 +659,6 @@ gst_wavparse_handle_seek (GstWavParse * wav)
gst_pad_event_default (wav->sinkpad, event);
return TRUE;
-#else
- return FALSE;
-#endif
}
#define MAX_BUFFER_SIZE 4096
@@ -880,7 +876,6 @@ gst_wavparse_get_event_masks (GstPad * pad)
static gboolean
gst_wavparse_srcpad_event (GstPad * pad, GstEvent * event)
{
-#if 1
GstWavParse *wavparse = GST_WAVPARSE (GST_PAD_PARENT (pad));
gboolean res = FALSE;
@@ -913,9 +908,6 @@ gst_wavparse_srcpad_event (GstPad * pad, GstEvent * event)
gst_event_unref (event);
return res;
-#else
- return FALSE;
-#endif
}
static GstElementStateReturn