mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-02 02:26:44 +01:00
GstEnginePipeline: Refactor code
This commit is contained in:
parent
f3b70d1cb2
commit
0093eb6c2c
@ -614,14 +614,20 @@ GstPadProbeReturn GstEnginePipeline::HandoffCallback(GstPad *pad, GstPadProbeInf
|
|||||||
|
|
||||||
GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(self);
|
GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(self);
|
||||||
|
|
||||||
GstCaps *caps = gst_pad_get_current_caps(pad);
|
QString format;
|
||||||
GstStructure *structure = gst_caps_get_structure(caps, 0);
|
|
||||||
QString format = QString(gst_structure_get_string(structure, "format"));
|
|
||||||
int channels = 0;
|
int channels = 0;
|
||||||
int rate = 0;
|
int rate = 0;
|
||||||
gst_structure_get_int(structure, "channels", &channels);
|
|
||||||
gst_structure_get_int(structure, "rate", &rate);
|
GstCaps *caps = gst_pad_get_current_caps(pad);
|
||||||
gst_caps_unref(caps);
|
if (caps) {
|
||||||
|
GstStructure *structure = gst_caps_get_structure(caps, 0);
|
||||||
|
if (structure) {
|
||||||
|
format = QString(gst_structure_get_string(structure, "format"));
|
||||||
|
gst_structure_get_int(structure, "channels", &channels);
|
||||||
|
gst_structure_get_int(structure, "rate", &rate);
|
||||||
|
}
|
||||||
|
gst_caps_unref(caps);
|
||||||
|
}
|
||||||
|
|
||||||
GstBuffer *buf = gst_pad_probe_info_get_buffer(info);
|
GstBuffer *buf = gst_pad_probe_info_get_buffer(info);
|
||||||
GstBuffer *buf16 = nullptr;
|
GstBuffer *buf16 = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user