From 77ec1207d3d5d6e4bc8a29a735234b0ef217ae19 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 28 Jul 2004 09:36:10 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ gst/wavparse/gstwavparse.c | 12 ++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6c8382b8e..b226c21c6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-07-28 Wim Taymans + + * 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. + 2004-07-27 Steve Lhomme * gst/median/gstmedian.c: diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 2b17adc090..e231feb6eb 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