summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-10-02 10:10:11 +0300
committerSebastian Dröge <sebastian@centricular.com>2014-10-14 09:37:10 +0200
commite394ad4b9b1ff0fa31a4903a8f07b6fc7bdb455d (patch)
tree857829dde77fa429a2bb1d0050feaa4dbb5feb29
parentd41a0be89044fff0aa6d477518cd8ce3faefc04d (diff)
wavenc: Send CAPS event after the pad was activated
Otherwise the CAPS event will be dropped and we never configure any caps at all, leading to weird behaviour in many situations. Especially header rewriting is not going to work if a capsfilter is after wavenc. https://bugzilla.gnome.org/show_bug.cgi?id=737735
-rw-r--r--gst/wavenc/gstwavenc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gst/wavenc/gstwavenc.c b/gst/wavenc/gstwavenc.c
index 9f62fc7ac..29bfad41a 100644
--- a/gst/wavenc/gstwavenc.c
+++ b/gst/wavenc/gstwavenc.c
@@ -197,8 +197,6 @@ gst_wavenc_init (GstWavEnc * wavenc)
wavenc->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
gst_pad_use_fixed_caps (wavenc->srcpad);
- gst_pad_set_caps (wavenc->srcpad,
- gst_static_pad_template_get_caps (&src_factory));
gst_element_add_pad (GST_ELEMENT (wavenc), wavenc->srcpad);
}
@@ -264,7 +262,10 @@ gst_wavenc_push_header (GstWavEnc * wavenc)
/* seek to beginning of file */
gst_segment_init (&segment, GST_FORMAT_BYTES);
- gst_pad_push_event (wavenc->srcpad, gst_event_new_segment (&segment));
+ if (!gst_pad_push_event (wavenc->srcpad, gst_event_new_segment (&segment))) {
+ GST_WARNING_OBJECT (wavenc, "Seek to the beginning failed");
+ return GST_FLOW_ERROR;
+ }
GST_DEBUG_OBJECT (wavenc, "writing header, meta_size=%u, audio_size=%u",
wavenc->meta_length, wavenc->audio_length);
@@ -854,6 +855,9 @@ gst_wavenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
}
if (G_UNLIKELY (!wavenc->sent_header)) {
+ gst_pad_set_caps (wavenc->srcpad,
+ gst_static_pad_template_get_caps (&src_factory));
+
/* starting a file, means we have to finish it properly */
wavenc->finished_properly = FALSE;