|
13 | 13 | GstEndOfStream, |
14 | 14 | GstError, |
15 | 15 | GstMissingPlugin, |
| 16 | + GstPlayFlags, |
16 | 17 | GstState, |
17 | 18 | GstStateChanged, |
18 | 19 | GstStreamStart, |
|
38 | 39 | # set_state() on a pipeline. |
39 | 40 | gst_logger = logging.getLogger("mopidy.audio.gst") |
40 | 41 |
|
41 | | -GST_PLAY_FLAGS_AUDIO = 0x02 |
42 | | -GST_PLAY_FLAGS_DOWNLOAD = 0x80 |
43 | | - |
44 | 42 |
|
45 | 43 | class GstOutputBin(Gst.Bin): |
46 | 44 | """A bin that sends its input to one or more audio outputs.""" |
@@ -154,7 +152,7 @@ def _make_playbin( |
154 | 152 | if playbin is None: |
155 | 153 | msg = "Failed to create GStreamer playbin." |
156 | 154 | raise exceptions.AudioException(msg) |
157 | | - playbin.set_property("flags", GST_PLAY_FLAGS_AUDIO) |
| 155 | + playbin.set_property("flags", GstPlayFlags.AUDIO) |
158 | 156 |
|
159 | 157 | # TODO: turn into config values... |
160 | 158 | playbin.set_property("buffer-size", 5 << 20) # 5MB |
@@ -314,9 +312,9 @@ def _decode_segment(segment: Gst.Segment) -> DurationMs: |
314 | 312 |
|
315 | 313 | def set_uri(self, uri: str, *, download: bool = False) -> None: |
316 | 314 | """Set the URI to play, and the buffering flags to use for it.""" |
317 | | - flags = GST_PLAY_FLAGS_AUDIO |
| 315 | + flags = GstPlayFlags.AUDIO |
318 | 316 | if download: |
319 | | - flags |= GST_PLAY_FLAGS_DOWNLOAD |
| 317 | + flags |= GstPlayFlags.DOWNLOAD |
320 | 318 |
|
321 | 319 | logger.debug(f"Flags: {flags}") |
322 | 320 | self.playbin.set_property("flags", flags) |
|
0 commit comments