diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2005-05-09 17:07:27 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2005-05-09 17:07:27 +0000 |
commit | 8aeaf8ed14a92798e138c6b27b13bbd287b27b61 (patch) | |
tree | df4283fbca15bab7753395387343d47a8f333bd6 /ext | |
parent | 13803bc40fad386850a6cdab47d9d4638ba9f0db (diff) |
Make caps writable before writing to it.
Original commit message from CVS:
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_setcaps),
(gst_vorbisenc_src_query), (gst_vorbisenc_sink_query),
(gst_vorbisenc_set_header_on_caps), (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
Make caps writable before writing to it.
Fix negotiation in audioconvert some more.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/vorbis/vorbisenc.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/vorbis/vorbisenc.c b/ext/vorbis/vorbisenc.c index 980cf11cc..3a0aee266 100644 --- a/ext/vorbis/vorbisenc.c +++ b/ext/vorbis/vorbisenc.c @@ -241,7 +241,7 @@ gst_vorbisenc_sink_setcaps (GstPad * pad, GstCaps * caps) VorbisEnc *vorbisenc; GstStructure *structure; - vorbisenc = GST_VORBISENC (gst_pad_get_parent (pad)); + vorbisenc = GST_VORBISENC (GST_PAD_PARENT (pad)); vorbisenc->setup = FALSE; structure = gst_caps_get_structure (caps, 0); @@ -783,14 +783,17 @@ gst_vorbisenc_push_packet (VorbisEnc * vorbisenc, ogg_packet * packet) gst_vorbisenc_push_buffer (vorbisenc, outbuf); } -static void +static GstCaps * gst_vorbisenc_set_header_on_caps (GstCaps * caps, GstBuffer * buf1, GstBuffer * buf2, GstBuffer * buf3) { - GstStructure *structure = gst_caps_get_structure (caps, 0); + GstStructure *structure; GValue list = { 0 }; GValue value = { 0 }; + caps = gst_caps_make_writable (caps); + structure = gst_caps_get_structure (caps, 0); + /* mark buffers */ GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_IN_CAPS); GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_IN_CAPS); @@ -812,6 +815,8 @@ gst_vorbisenc_set_header_on_caps (GstCaps * caps, GstBuffer * buf1, gst_structure_set_value (structure, "streamheader", &list); g_value_unset (&value); g_value_unset (&list); + + return caps; } static gboolean @@ -895,7 +900,7 @@ gst_vorbisenc_chain (GstPad * pad, GstBuffer * buffer) /* mark and put on caps */ caps = gst_pad_get_caps (vorbisenc->srcpad); - gst_vorbisenc_set_header_on_caps (caps, buf1, buf2, buf3); + caps = gst_vorbisenc_set_header_on_caps (caps, buf1, buf2, buf3); /* negotiate with these caps */ GST_DEBUG ("here are the caps: %" GST_PTR_FORMAT, caps); |