From 7fdaff079df9a1e24ce82f060df6e4e7979558c1 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Tue, 3 Dec 2013 20:31:41 +1100 Subject: [PATCH] Don't try to stop the chromaprinter event loop a second time after it's already been stopped. This can happen if the song is exactly 30 seconds long. Fixes issue 4001 --- src/musicbrainz/chromaprinter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/musicbrainz/chromaprinter.cpp b/src/musicbrainz/chromaprinter.cpp index b3766b673..ea1ae2f33 100644 --- a/src/musicbrainz/chromaprinter.cpp +++ b/src/musicbrainz/chromaprinter.cpp @@ -190,6 +190,9 @@ void Chromaprinter::ReportError(GstMessage* msg) { gboolean Chromaprinter::BusCallback(GstBus*, GstMessage* msg, gpointer data) { Chromaprinter* instance = reinterpret_cast(data); + if (instance->finishing_) { + return GST_BUS_DROP; + } switch (GST_MESSAGE_TYPE(msg)) { case GST_MESSAGE_ERROR: @@ -205,6 +208,9 @@ gboolean Chromaprinter::BusCallback(GstBus*, GstMessage* msg, gpointer data) { GstBusSyncReply Chromaprinter::BusCallbackSync(GstBus*, GstMessage* msg, gpointer data) { Chromaprinter* instance = reinterpret_cast(data); + if (instance->finishing_) { + return GST_BUS_PASS; + } switch (GST_MESSAGE_TYPE(msg)) { case GST_MESSAGE_EOS: