Skip to content

Instantly share code, notes, and snippets.

@knocte
Created October 12, 2013 22:05
Show Gist options
  • Save knocte/6955438 to your computer and use it in GitHub Desktop.
Save knocte/6955438 to your computer and use it in GitHub Desktop.
makes more sense?
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs
index d413918..f63dce9 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)
+ private PadProbeReturn BlockCallback (Pad pad, PadProbeInfo info)
{
- if (!blocked) {
- // Set thawing mode (discards buffers that are too old from the queue).
- vis_thawing = true;
- }
+ return PadProbeReturn.Ok;
}
-
+
+ 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 (!block_probe.HasValue) {
+ block_probe = queue_sink.AddProbe (PadProbeType.Block, BlockCallback);
+ } else {
+ 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