Date: Friday, November 8, 2013 @ 02:59:09 Author: bisson Revision: 199062
fix "stuck at next playlist entry" issue Added: mpd/trunk/77c63511d8809f7785328138e7e3a50303302730.patch Modified: mpd/trunk/PKGBUILD ------------------------------------------------+ 77c63511d8809f7785328138e7e3a50303302730.patch | 53 +++++++++++++++++++++++ PKGBUILD | 5 +- 2 files changed, 57 insertions(+), 1 deletion(-) Added: 77c63511d8809f7785328138e7e3a50303302730.patch =================================================================== --- 77c63511d8809f7785328138e7e3a50303302730.patch (rev 0) +++ 77c63511d8809f7785328138e7e3a50303302730.patch 2013-11-08 01:59:09 UTC (rev 199062) @@ -0,0 +1,53 @@ +From 77c63511d8809f7785328138e7e3a50303302730 Mon Sep 17 00:00:00 2001 +From: Max Kellermann <[email protected]> +Date: Wed, 06 Nov 2013 22:30:29 +0000 +Subject: PlayerThread: reduce the number of DecoderThread wakeups + +After the number of decoded chunks has fallen below the threshold, the +PlayerThread woke up the DecoderThread over and over. This commit +adds a boolean flag that avoids these duplicate wakeups, and thus +reduces the number of system calls. +--- +diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx +index e2e3ee3..cb3d6a9 100644 +--- a/src/PlayerThread.cxx ++++ b/src/PlayerThread.cxx +@@ -69,6 +69,12 @@ class Player { + bool decoder_starting; + + /** ++ * Did we wake up the DecoderThread recently? This avoids ++ * duplicate wakeup calls. ++ */ ++ bool decoder_woken; ++ ++ /** + * is the player paused? + */ + bool paused; +@@ -133,6 +139,7 @@ public: + :pc(_pc), dc(_dc), buffer(_buffer), + buffering(true), + decoder_starting(false), ++ decoder_woken(false), + paused(false), + queued(true), + output_open(false), +@@ -861,8 +868,13 @@ Player::PlayNextChunk() + pc.Lock(); + if (!dc.IsIdle() && + dc.pipe->GetSize() <= (pc.buffered_before_play + +- buffer.GetSize() * 3) / 4) +- dc.Signal(); ++ buffer.GetSize() * 3) / 4) { ++ if (!decoder_woken) { ++ decoder_woken = true; ++ dc.Signal(); ++ } ++ } else ++ decoder_woken = false; + pc.Unlock(); + + return true; +-- +cgit v0.9.1-27-gd5a4 Modified: PKGBUILD =================================================================== --- PKGBUILD 2013-11-08 01:17:53 UTC (rev 199061) +++ PKGBUILD 2013-11-08 01:59:09 UTC (rev 199062) @@ -7,7 +7,7 @@ pkgname=mpd pkgver=0.18.2 -pkgrel=1 +pkgrel=2 pkgdesc='Flexible, powerful, server-side application for playing music' url='http://www.musicpd.org/' license=('GPL') @@ -16,9 +16,11 @@ 'sqlite' 'jack' 'libmms' 'wavpack' 'avahi' 'libid3tag' 'yajl') makedepends=('doxygen') source=("http://www.musicpd.org/download/${pkgname}/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz"{,.sig} + '77c63511d8809f7785328138e7e3a50303302730.patch' 'tmpfiles.d' 'conf') sha1sums=('116f4cf0147320abd5253435c4be134a1d5eace8' 'SKIP' + '361122fa0267fbfc1a37cc953f9aadfa55fa0193' 'f4d5922abb69abb739542d8e93f4dfd748acdad7' '67c145c046cddd885630d72ce8ebe71f8321ff3b') @@ -27,6 +29,7 @@ prepare() { cd "${srcdir}/${pkgname}-${pkgver}" + patch -R -p1 -i ../77c63511d8809f7785328138e7e3a50303302730.patch # http://bugs.musicpd.org/view.php?id=3860 sed 's:cdio/paranoia.h:cdio/paranoia/paranoia.h:g' -i src/input/CdioParanoiaInputPlugin.cxx }
