spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 58517e72bef0fef09c032ef6ef9d9b026c512377
parent 41a1b70aa460627e94d314d5e0d34292037ea58d
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Sun, 30 May 2010 13:38:03 +1000

Fix sample rate of DTS files

Diffstat:
Msrc/spek-source.vala | 19++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/spek-source.vala b/src/spek-source.vala @@ -94,12 +94,21 @@ namespace Spek { var caps = pad.get_caps (); for (int i = 0; i < caps.get_size (); i++) { var structure = caps.get_structure (i); - int n = 0; - if (rate == 0 && structure.get_int ("rate", out n)) { - rate = n; + Gst.Value? val; + int n; + if (rate == 0 && (val = structure.get_value ("rate")) != null) { + if (val.type () == typeof (int)) { + rate = val.get_int (); + } else if (val.type () == typeof (IntRange)) { + rate = val.get_int_range_max (); + } } - if (channels == 0 && structure.get_int ("channels", out n)) { - channels = n; + if (channels == 0 && (val = structure.get_value ("channels")) != null) { + if (val.type () == typeof (int)) { + channels = val.get_int (); + } else if (val.type () == typeof (IntRange)) { + channels = val.get_int_range_max (); + } } if (depth == 0 && structure.get_int ("depth", out n)) { depth = n;