mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
interaudiosrc: Fail in set_caps() if the caps can't be parsed
This commit is contained in:
parent
f1b99f04dc
commit
fae814aef8
1 changed files with 12 additions and 7 deletions
|
@ -195,17 +195,22 @@ gst_inter_audio_src_set_caps (GstBaseSrc * src, GstCaps * caps)
|
||||||
|
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
|
|
||||||
ret = gst_structure_get_int (structure, "rate", &sample_rate);
|
if (!gst_structure_get_int (structure, "rate", &sample_rate)) {
|
||||||
if (ret) {
|
GST_ERROR_OBJECT (src, "Audio caps without rate");
|
||||||
interaudiosrc->sample_rate = sample_rate;
|
return FALSE;
|
||||||
|
|
||||||
ret = gst_pad_set_caps (src->srcpad, caps);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gst_audio_info_from_caps (&info, caps)) {
|
interaudiosrc->sample_rate = sample_rate;
|
||||||
interaudiosrc->finfo = info.finfo;
|
|
||||||
|
if (!gst_audio_info_from_caps (&info, caps)) {
|
||||||
|
GST_ERROR_OBJECT (src, "Can't parse audio caps");
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interaudiosrc->finfo = info.finfo;
|
||||||
|
|
||||||
|
ret = gst_pad_set_caps (src->srcpad, caps);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue