Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/org/freedesktop/gstreamer/Pad.java
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public void block(final Runnable callback) {
public PadProbeReturn eventReceived(Pad pad, Event event) {
callback.run();
pad.removeCallback(EVENT_PROBE.class, this);
return PadProbeReturn.DROP;
return PadProbeReturn.REMOVE;
}
}, GstPadAPI.GST_PAD_PROBE_TYPE_BLOCKING | GstPadAPI.GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM);
}
Expand Down Expand Up @@ -404,7 +404,14 @@ public PadProbeReturn callback(Pad pad, GstPadProbeInfo probeInfo, Pointer user_
}
};

GCallback cb = new GCallback(handle.addProbe(mask, probe), probe) {
NativeLong id = handle.addProbe(mask, probe);
if (id.longValue() == 0) {
// the Probe was an IDLE-Probe and it was already handled synchronously in handle.addProbe,
// so no Callback needs to be registered
return;
}

GCallback cb = new GCallback(id, probe) {
@Override
protected void disconnect() {
handle.removeProbe(id);
Expand Down