mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-23 17:14:23 +00:00
gst/interleave/interleave.c (interleave_buffered_loop): Always push only when channel->buffer is NULL. Prevents segfa...
Original commit message from CVS: 2004-02-25 Andy Wingo <wingo@pobox.com> * gst/interleave/interleave.c (interleave_buffered_loop): Always push only when channel->buffer is NULL. Prevents segfaults doing the state change after a nonlocal exit, like a scheme exception. * gst/audioconvert/gstaudioconvert.c (gst_audio_convert_getcaps): Handle the case where the intersected caps is empty.
This commit is contained in:
parent
cf70765aca
commit
cd8976a9eb
2 changed files with 16 additions and 10 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2004-02-25 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* gst/interleave/interleave.c (interleave_buffered_loop): Always
|
||||||
|
push only when channel->buffer is NULL. Prevents segfaults doing
|
||||||
|
the state change after a nonlocal exit, like a scheme exception.
|
||||||
|
|
||||||
|
* gst/audioconvert/gstaudioconvert.c (gst_audio_convert_getcaps):
|
||||||
|
Handle the case where the intersected caps is empty.
|
||||||
|
|
||||||
2004-02-25 Thomas Vander Stichele <thomas at apestaart dot org>
|
2004-02-25 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* gst/law/mulaw-decode.c: (mulawdec_link):
|
* gst/law/mulaw-decode.c: (mulawdec_link):
|
||||||
|
|
|
@ -293,12 +293,6 @@ gst_audio_convert_chain_int2float (GstPad *pad, GstData *data)
|
||||||
/* we know we're negotiated, because it's the link function that set the
|
/* we know we're negotiated, because it's the link function that set the
|
||||||
custom chain handler */
|
custom chain handler */
|
||||||
|
|
||||||
/* FIXME: this runs into scheduling problems if the next element is loop-based
|
|
||||||
* (the bufpen fills up until infinity because we push multiple buffers per
|
|
||||||
* chain, in the normal situation). The fix is either to make the opt
|
|
||||||
* scheduler choose the loop group as its entry, or to make this a loop
|
|
||||||
* plugin. But I want to commit, will fix this later. */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Theory of operation:
|
* Theory of operation:
|
||||||
* - convert the format (endianness, signedness, width, depth) to
|
* - convert the format (endianness, signedness, width, depth) to
|
||||||
|
@ -397,7 +391,7 @@ gst_audio_convert_getcaps (GstPad *pad)
|
||||||
GstCaps *othercaps, *caps;
|
GstCaps *othercaps, *caps;
|
||||||
const GstCaps *templcaps;
|
const GstCaps *templcaps;
|
||||||
gboolean has_float = FALSE, has_int = FALSE;
|
gboolean has_float = FALSE, has_int = FALSE;
|
||||||
int i;
|
int i, size;
|
||||||
|
|
||||||
g_return_val_if_fail(GST_IS_PAD(pad), NULL);
|
g_return_val_if_fail(GST_IS_PAD(pad), NULL);
|
||||||
g_return_val_if_fail(GST_IS_AUDIO_CONVERT(GST_OBJECT_PARENT (pad)), NULL);
|
g_return_val_if_fail(GST_IS_AUDIO_CONVERT(GST_OBJECT_PARENT (pad)), NULL);
|
||||||
|
@ -409,7 +403,9 @@ gst_audio_convert_getcaps (GstPad *pad)
|
||||||
templcaps = gst_pad_get_pad_template_caps (pad);
|
templcaps = gst_pad_get_pad_template_caps (pad);
|
||||||
othercaps = gst_pad_get_allowed_caps (otherpad);
|
othercaps = gst_pad_get_allowed_caps (otherpad);
|
||||||
|
|
||||||
for (i=0;i<gst_caps_get_size (othercaps); i++) {
|
size = gst_caps_get_size (othercaps);
|
||||||
|
|
||||||
|
for (i=0; i<size; i++) {
|
||||||
structure = gst_caps_get_structure (othercaps, i);
|
structure = gst_caps_get_structure (othercaps, i);
|
||||||
gst_structure_remove_field (structure, "channels");
|
gst_structure_remove_field (structure, "channels");
|
||||||
gst_structure_remove_field (structure, "endianness");
|
gst_structure_remove_field (structure, "endianness");
|
||||||
|
@ -425,17 +421,18 @@ gst_audio_convert_getcaps (GstPad *pad)
|
||||||
}
|
}
|
||||||
caps = gst_caps_intersect (othercaps, templcaps);
|
caps = gst_caps_intersect (othercaps, templcaps);
|
||||||
gst_caps_free (othercaps);
|
gst_caps_free (othercaps);
|
||||||
|
size = gst_caps_get_size (caps);
|
||||||
|
|
||||||
/* the intersection probably lost either float or int. so we take the rate
|
/* the intersection probably lost either float or int. so we take the rate
|
||||||
* property and set it on a copy of the templcaps struct. */
|
* property and set it on a copy of the templcaps struct. */
|
||||||
if (!has_int) {
|
if (!has_int && size) {
|
||||||
structure = gst_structure_copy (gst_caps_get_structure (templcaps, 0));
|
structure = gst_structure_copy (gst_caps_get_structure (templcaps, 0));
|
||||||
gst_structure_set_value (structure, "rate",
|
gst_structure_set_value (structure, "rate",
|
||||||
gst_structure_get_value (gst_caps_get_structure (caps, 0),
|
gst_structure_get_value (gst_caps_get_structure (caps, 0),
|
||||||
"rate"));
|
"rate"));
|
||||||
gst_caps_append_structure (caps, structure);
|
gst_caps_append_structure (caps, structure);
|
||||||
}
|
}
|
||||||
if (!has_float) {
|
if (!has_float && size) {
|
||||||
structure = gst_structure_copy (gst_caps_get_structure (templcaps, 1));
|
structure = gst_structure_copy (gst_caps_get_structure (templcaps, 1));
|
||||||
gst_structure_set_value (structure, "rate",
|
gst_structure_set_value (structure, "rate",
|
||||||
gst_structure_get_value (gst_caps_get_structure (caps, 0),
|
gst_structure_get_value (gst_caps_get_structure (caps, 0),
|
||||||
|
|
Loading…
Reference in a new issue