diff options
author | riggs <riggs@FreeBSD.org> | 2015-08-02 22:03:56 +0800 |
---|---|---|
committer | riggs <riggs@FreeBSD.org> | 2015-08-02 22:03:56 +0800 |
commit | a884e1209be060577bc532b255dada098f722aee (patch) | |
tree | 79a1c7c2ab19b721d6d353742455da970a336de6 /audio | |
parent | 11b3fc1385ac54778b00bedb6a6b90dc376b0894 (diff) | |
download | freebsd-ports-gnome-a884e1209be060577bc532b255dada098f722aee.tar.gz freebsd-ports-gnome-a884e1209be060577bc532b255dada098f722aee.tar.zst freebsd-ports-gnome-a884e1209be060577bc532b255dada098f722aee.zip |
Fix shuffle playback
(random number generator is not initialised properly)
While on it:
Pet portlint
PR: 201645
Submitted by: yamagi@yamagi.org (maintainer)
MFH: 2015Q3
Diffstat (limited to 'audio')
-rw-r--r-- | audio/ncmpcpp/Makefile | 1 | ||||
-rw-r--r-- | audio/ncmpcpp/files/patch-src__status.cpp | 4 | ||||
-rw-r--r-- | audio/ncmpcpp/files/patch-src_mpdpp.cpp | 29 | ||||
-rw-r--r-- | audio/ncmpcpp/files/patch-src_mpdpp.h | 19 |
4 files changed, 51 insertions, 2 deletions
diff --git a/audio/ncmpcpp/Makefile b/audio/ncmpcpp/Makefile index 9bbf06dc498a..2e774d200afd 100644 --- a/audio/ncmpcpp/Makefile +++ b/audio/ncmpcpp/Makefile @@ -2,6 +2,7 @@ PORTNAME= ncmpcpp PORTVERSION= 0.6.5 +PORTREVISION= 1 CATEGORIES= audio MASTER_SITES= http://ncmpcpp.rybczak.net/stable/ diff --git a/audio/ncmpcpp/files/patch-src__status.cpp b/audio/ncmpcpp/files/patch-src__status.cpp index 61651221eaea..a7fafc7595f9 100644 --- a/audio/ncmpcpp/files/patch-src__status.cpp +++ b/audio/ncmpcpp/files/patch-src__status.cpp @@ -1,5 +1,5 @@ ---- src/status.cpp_orig 2014-11-16 09:21:55.651181899 +0100 -+++ src/status.cpp 2014-11-16 09:21:59.233203196 +0100 +--- src/status.cpp.orig 2015-07-05 02:18:34 UTC ++++ src/status.cpp @@ -21,6 +21,8 @@ #include <boost/date_time/posix_time/posix_time.hpp> #include <netinet/tcp.h> diff --git a/audio/ncmpcpp/files/patch-src_mpdpp.cpp b/audio/ncmpcpp/files/patch-src_mpdpp.cpp new file mode 100644 index 000000000000..41043282691c --- /dev/null +++ b/audio/ncmpcpp/files/patch-src_mpdpp.cpp @@ -0,0 +1,29 @@ +--- src/mpdpp.cpp.orig 2015-07-05 02:18:34 UTC ++++ src/mpdpp.cpp +@@ -38,6 +38,8 @@ Connection::Connection() : m_connection( + m_port(6600), + m_timeout(15) + { ++ std::random_device rd; ++ m_gen.seed(rd()); + } + + Connection::~Connection() +@@ -504,7 +506,7 @@ bool Connection::AddRandomTag(mpd_tag_ty + } + else + { +- std::random_shuffle(tags.begin(), tags.end()); ++ std::shuffle(tags.begin(), tags.end(), m_gen); + auto it = tags.begin(); + for (size_t i = 0; i < number && it != tags.end(); ++i) + { +@@ -544,7 +546,7 @@ bool Connection::AddRandomSongs(size_t n + } + else + { +- std::random_shuffle(files.begin(), files.end()); ++ std::shuffle(files.begin(), files.end(), m_gen); + StartCommandsList(); + auto it = files.begin(); + for (size_t i = 0; i < number && it != files.end(); ++i, ++it) diff --git a/audio/ncmpcpp/files/patch-src_mpdpp.h b/audio/ncmpcpp/files/patch-src_mpdpp.h new file mode 100644 index 000000000000..31c1f17e81b8 --- /dev/null +++ b/audio/ncmpcpp/files/patch-src_mpdpp.h @@ -0,0 +1,19 @@ +--- src/mpdpp.h.orig 2015-07-05 02:18:34 UTC ++++ src/mpdpp.h +@@ -23,6 +23,7 @@ + + #include <cassert> + #include <exception> ++#include <random> + #include <set> + #include <vector> + +@@ -277,6 +278,8 @@ private: + std::string m_password; + + mpd_tag_type m_searched_field; ++ ++ std::mt19937 m_gen; + }; + + } |