|
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 |