From 129894c01ed90609aae953aee800e4cb6d6322e8 Mon Sep 17 00:00:00 2001 From: Zan Dobersek Date: Mon, 25 Mar 2013 20:10:05 +0100 Subject: [PATCH] Clean up gst.Caps initialization There's no need for appending every audio/x-raw-* structure to the gst.Caps individually, they can all be listed inline inside the gst.Caps initialization. (cherry picked from commit 13f0bfffe17c07ddbc3a8e5fc1e29c0015502392) --- mopidy/scanner.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mopidy/scanner.py b/mopidy/scanner.py index 041f6fc4..4b057774 100644 --- a/mopidy/scanner.py +++ b/mopidy/scanner.py @@ -152,12 +152,9 @@ class Scanner(object): self.fakesink.set_property('signal-handoffs', True) self.fakesink.connect('handoff', self.process_handoff) - uribin_caps = gst.Caps() - uribin_caps.append_structure(gst.structure_from_string(b'audio/x-raw-int')) - uribin_caps.append_structure(gst.structure_from_string(b'audio/x-raw-float')) - self.uribin = gst.element_factory_make('uridecodebin') - self.uribin.set_property('caps', uribin_caps) + self.uribin.set_property('caps', + gst.Caps(b'audio/x-raw-int; audio/x-raw-float')) self.uribin.connect('pad-added', self.process_new_pad) self.pipe = gst.element_factory_make('pipeline')