gst/audioconvert/gstaudioconvert.c: fixate nicely even when the peer is not negotiating
Original commit message from CVS: * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_fixate): fixate nicely even when the peer is not negotiating
This commit is contained in:
parent
4f845c50ce
commit
b95a7dca6a
@ -1,3 +1,8 @@
|
|||||||
|
2004-05-26 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||||
|
|
||||||
|
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_fixate):
|
||||||
|
fixate nicely even when the peer is not negotiating
|
||||||
|
|
||||||
2004-05-25 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
2004-05-25 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||||
|
|
||||||
* gst/audioconvert/gstaudioconvert.c:
|
* gst/audioconvert/gstaudioconvert.c:
|
||||||
|
@ -492,23 +492,29 @@ gst_audio_convert_fixate (GstPad * pad, const GstCaps * caps)
|
|||||||
GstAudioConvert *this =
|
GstAudioConvert *this =
|
||||||
GST_AUDIO_CONVERT (gst_object_get_parent (GST_OBJECT (pad)));
|
GST_AUDIO_CONVERT (gst_object_get_parent (GST_OBJECT (pad)));
|
||||||
GstPad *otherpad = (pad == this->sink ? this->src : this->sink);
|
GstPad *otherpad = (pad == this->sink ? this->src : this->sink);
|
||||||
GstAudioConvertCaps ac_caps =
|
GstAudioConvertCaps try, ac_caps =
|
||||||
(pad == this->sink ? this->srccaps : this->sinkcaps);
|
(pad == this->sink ? this->srccaps : this->sinkcaps);
|
||||||
GstCaps *copy;
|
GstCaps *copy = gst_caps_copy (caps);
|
||||||
|
|
||||||
/* only fixate when we're proxying, so we don't fixate to some crap the other side doesn't want */
|
if (!GST_PAD_IS_NEGOTIATING (otherpad)) {
|
||||||
if (!GST_PAD_IS_NEGOTIATING (otherpad))
|
try.channels = 2;
|
||||||
return NULL;
|
try.width = 16;
|
||||||
|
try.depth = 16;
|
||||||
|
try.endianness = G_BYTE_ORDER;
|
||||||
|
} else {
|
||||||
|
try.channels = ac_caps.channels;
|
||||||
|
try.width = ac_caps.is_int ? ac_caps.width : 16;
|
||||||
|
try.depth = ac_caps.is_int ? ac_caps.depth : 16;
|
||||||
|
try.endianness = ac_caps.is_int ? ac_caps.endianness : G_BYTE_ORDER;
|
||||||
|
}
|
||||||
|
|
||||||
copy = gst_caps_copy (caps);
|
if (_fixate_caps_to_int (©, "channels", try.channels))
|
||||||
if (_fixate_caps_to_int (©, "channels", ac_caps.channels))
|
|
||||||
return copy;
|
return copy;
|
||||||
if (_fixate_caps_to_int (©, "width", ac_caps.is_int ? ac_caps.width : 16))
|
if (_fixate_caps_to_int (©, "width", try.width))
|
||||||
return copy;
|
return copy;
|
||||||
if (_fixate_caps_to_int (©, "depth", ac_caps.is_int ? ac_caps.depth : 16))
|
if (_fixate_caps_to_int (©, "depth", try.depth))
|
||||||
return copy;
|
return copy;
|
||||||
if (_fixate_caps_to_int (©, "endianness",
|
if (_fixate_caps_to_int (©, "endianness", try.endianness))
|
||||||
ac_caps.is_int ? ac_caps.endianness : G_BYTE_ORDER))
|
|
||||||
return copy;
|
return copy;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user