gst/matroska/matroska-demux.c: Don't error out when the source pad isn't linked.

Original commit message from CVS:
* gst/matroska/matroska-demux.c:
(gst_matroska_demux_push_vorbis_codec_priv_data),
(gst_matroska_demux_add_wvpk_header):
Don't error out when the source pad isn't linked.
This commit is contained in:
Tim-Philipp Müller 2005-11-07 10:27:00 +00:00
parent 98d290b864
commit 7eb9e37532
2 changed files with 19 additions and 17 deletions

View file

@ -1,3 +1,10 @@
2005-11-07 Tim-Philipp Müller <tim at centricular dot net>
* gst/matroska/matroska-demux.c:
(gst_matroska_demux_push_vorbis_codec_priv_data),
(gst_matroska_demux_add_wvpk_header):
Don't error out when the source pad isn't linked.
2005-11-02 Tim-Philipp Müller <tim at centricular dot net> 2005-11-02 Tim-Philipp Müller <tim at centricular dot net>
* ext/gconf/gstgconfaudiosink.c: (do_toggle_element), * ext/gconf/gstgconfaudiosink.c: (do_toggle_element),

View file

@ -2008,28 +2008,23 @@ gst_matroska_demux_push_vorbis_codec_priv_data (GstMatroskaDemux * demux,
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
length = p[i + 1]; length = p[i + 1];
if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE, if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE,
length, stream->caps, &priv) != GST_FLOW_OK) { length, stream->caps, &priv) == GST_FLOW_OK) {
return FALSE;
}
memcpy (GST_BUFFER_DATA (priv), &p[offset], length); memcpy (GST_BUFFER_DATA (priv), &p[offset], length);
ret = gst_pad_push (stream->pad, priv); ret = gst_pad_push (stream->pad, priv);
if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED) if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED)
return FALSE; return FALSE;
}
offset += length; offset += length;
} }
length = stream->codec_priv_size - offset; length = stream->codec_priv_size - offset;
if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE, length, if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE, length,
stream->caps, &priv) != GST_FLOW_OK) { stream->caps, &priv) == GST_FLOW_OK) {
return FALSE;
}
memcpy (GST_BUFFER_DATA (priv), &p[offset], length); memcpy (GST_BUFFER_DATA (priv), &p[offset], length);
ret = gst_pad_push (stream->pad, priv); ret = gst_pad_push (stream->pad, priv);
if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED) if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED)
return FALSE; return FALSE;
}
return TRUE; return TRUE;
} }
@ -2072,7 +2067,7 @@ gst_matroska_demux_add_wvpk_header (GstMatroskaTrackContext * stream,
newlen = block_length + sizeof (Wavpack4Header) - 12; newlen = block_length + sizeof (Wavpack4Header) - 12;
if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE, newlen, if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE, newlen,
stream->caps, &newbuf) != GST_FLOW_OK) { stream->caps, &newbuf) != GST_FLOW_OK) {
return FALSE; return TRUE; /* not an error, pad might not be linked */
} }
data = GST_BUFFER_DATA (newbuf); data = GST_BUFFER_DATA (newbuf);