Created
October 12, 2013 22:17
-
-
Save knocte/6955557 to your computer and use it in GitHub Desktop.
third time lucky
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs | |
index d413918..8259fa4 100644 | |
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs | |
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs | |
@@ -173,23 +175,27 @@ namespace Banshee.GStreamerSharp | |
"endianness = (int) BYTE_ORDER, " + | |
"width = (int) 32"); | |
- private void BlockCallback (Pad pad, bool blocked) | |
- { | |
- if (!blocked) { | |
- // Set thawing mode (discards buffers that are too old from the queue). | |
- vis_thawing = true; | |
- } | |
- } | |
- | |
+ ulong? block_probe = null; | |
private bool Blocked | |
{ | |
set { | |
if (vis_resampler == null) | |
return; | |
+ | |
Pad queue_sink = vis_resampler.GetStaticPad ("src"); | |
- queue_sink.SetBlocked (value, new PadBlockCallback (BlockCallback)); | |
+ if (value) { | |
+ if (!block_probe.HasValue) { | |
+ block_probe = queue_sink.AddProbe (PadProbeType.Block, () => PadProbeReturn.Ok); | |
+ } | |
+ } else { | |
+ if (block_probe.HasValue) { | |
+ queue_sink.RemoveProbe (block_probe.Value); | |
+ } | |
+ // Set thawing mode (discards buffers that are too old from the queue). | |
+ vis_thawing = true; | |
+ } | |
} | |
} | |
+ | |
private event VisualizationDataHandler OnDataAvailable = null; | |
public event VisualizationDataHandler DataAvailable { | |
add { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment