mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-09 16:28:54 +01:00
ebur128analysis: Check for valid channel-mask
This commit is contained in:
parent
483b42d2b8
commit
560712db21
@ -205,13 +205,16 @@ class EBUR128AnalysisImpl {
|
||||
static GstFlowReturn NewBufferCallback(GstAppSink *app_sink, gpointer self);
|
||||
};
|
||||
|
||||
FrameFormat::FrameFormat(GstCaps *caps) : channels(0), samplerate(0) {
|
||||
FrameFormat::FrameFormat(GstCaps *caps) : channels(0), channel_mask(0), samplerate(0) {
|
||||
|
||||
GstStructure *structure = gst_caps_get_structure(caps, 0);
|
||||
QString format_str = gst_structure_get_string(structure, "format");
|
||||
gst_structure_get_int(structure, "rate", &samplerate);
|
||||
gst_structure_get_int(structure, "channels", &channels);
|
||||
channel_mask = gst_value_get_bitmask(gst_structure_get_value(structure, "channel-mask"));
|
||||
const GValue *value = gst_structure_get_value(structure, "channel-mask");
|
||||
if (value) {
|
||||
channel_mask = gst_value_get_bitmask(value);
|
||||
}
|
||||
|
||||
if (format_str == "S16LE") {
|
||||
format = DataFormat::S16;
|
||||
|
Loading…
x
Reference in New Issue
Block a user