From c8ad7e3a414bb8452d7c4ee7c7f96fbd53b19865 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Wed, 2 Sep 2015 00:59:50 +0200 Subject: [PATCH] gst1: Replace Caps() with Caps.from_string() And audio/x-raw-int and audio/x-raw-float with audio/x-raw --- mopidy/audio/actor.py | 2 +- mopidy/audio/scan.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mopidy/audio/actor.py b/mopidy/audio/actor.py index 8f45a7b5..d51519be 100644 --- a/mopidy/audio/actor.py +++ b/mopidy/audio/actor.py @@ -560,7 +560,7 @@ class Audio(pykka.ThreadingActor): :type seek_data: callable which takes time position in ms """ self._appsrc.prepare( - Gst.Caps(bytes(caps)), need_data, enough_data, seek_data) + Gst.Caps.from_string(caps), need_data, enough_data, seek_data) self._playbin.set_property('uri', 'appsrc://') def emit_data(self, buffer_): diff --git a/mopidy/audio/scan.py b/mopidy/audio/scan.py index 3f221636..550b6c14 100644 --- a/mopidy/audio/scan.py +++ b/mopidy/audio/scan.py @@ -14,8 +14,6 @@ from mopidy.internal import encoding _Result = collections.namedtuple( 'Result', ('uri', 'tags', 'duration', 'seekable', 'mime', 'playable')) -_RAW_AUDIO = Gst.Caps(b'audio/x-raw-int; audio/x-raw-float') - # TODO: replace with a scan(uri, timeout=1000, proxy_config=None)? class Scanner(object): @@ -104,7 +102,7 @@ def _pad_added(element, pad, pipeline): sink.sync_state_with_parent() pad.link(sink.get_static_pad('sink')) - if pad.query_caps().is_subset(_RAW_AUDIO): + if pad.query_caps().is_subset(Gst.Caps.from_string('audio/x-raw')): struct = Gst.Structure('have-audio') element.get_bus().post(Gst.message_new_application(element, struct))