View | Details | Raw Unified | Return to bug 201645
Collapse All | Expand All

(-)Makefile (+1 lines)
Lines 2-7 Link Here
2
2
3
PORTNAME=	ncmpcpp
3
PORTNAME=	ncmpcpp
4
PORTVERSION=	0.6.5
4
PORTVERSION=	0.6.5
5
PORTREVISION=	1
5
CATEGORIES=	audio
6
CATEGORIES=	audio
6
MASTER_SITES=	http://ncmpcpp.rybczak.net/stable/
7
MASTER_SITES=	http://ncmpcpp.rybczak.net/stable/
7
8
(-)files/patch-src_mpdpp.cpp (+32 lines)
Line 0 Link Here
1
--- src/mpdpp.cpp.orig	2015-07-05 02:18:34 UTC
2
+++ src/mpdpp.cpp
3
@@ -38,6 +38,8 @@ Connection::Connection() : m_connection(
4
 				m_port(6600),
5
 				m_timeout(15)
6
 {
7
+	std::random_device rd;
8
+	m_gen.seed(rd());
9
 }
10
 
11
 Connection::~Connection()
12
@@ -504,7 +506,7 @@ bool Connection::AddRandomTag(mpd_tag_ty
13
 	}
14
 	else
15
 	{
16
-		std::random_shuffle(tags.begin(), tags.end());
17
+		std::shuffle(tags.begin(), tags.end(), m_gen);
18
 		auto it = tags.begin();
19
 		for (size_t i = 0; i < number && it != tags.end(); ++i)
20
 		{
21
@@ -544,7 +546,7 @@ bool Connection::AddRandomSongs(size_t n
22
 	}
23
 	else
24
 	{
25
-		std::random_shuffle(files.begin(), files.end());
26
+		std::shuffle(files.begin(), files.end(), m_gen);
27
 		StartCommandsList();
28
 		auto it = files.begin();
29
 		for (size_t i = 0; i < number && it != files.end(); ++i, ++it)
30
yes
31
native
32
text/plain
(-)files/patch-src_mpdpp.h (+22 lines)
Line 0 Link Here
1
--- src/mpdpp.h.orig	2015-07-05 02:18:34 UTC
2
+++ src/mpdpp.h
3
@@ -23,6 +23,7 @@
4
 
5
 #include <cassert>
6
 #include <exception>
7
+#include <random>
8
 #include <set>
9
 #include <vector>
10
 
11
@@ -277,6 +278,8 @@ private:
12
 	std::string m_password;
13
 	
14
 	mpd_tag_type m_searched_field;
15
+
16
+	std::mt19937 m_gen;
17
 };
18
 
19
 }
20
yes
21
native
22
text/plain

Return to bug 201645