Max Kellermann
efb8a9bd2c
player, decoder, output: wrap MusicPipe in std::shared_ptr/std::unique_ptr
2018-06-23 18:45:57 +02:00
Max Kellermann
82954d1d6f
player/Thread: eliminate ClearAndReplacePipe()
...
Since commit e81b089612
, this is the
same code as in ReplacePipe().
2018-06-23 18:44:48 +02:00
Max Kellermann
2be905b2e2
MusicPipe: eliminate the unused MusicBuffer reference
...
This requires re-adding the reference to struct DecoderControl, which
was removed recently by commit
9f14e7a98d
2018-06-23 18:36:24 +02:00
Max Kellermann
54d295c247
MusicChunkPtr: managed MusicChunk pointer
...
Make all uses of MusicChunk safe.
2018-06-22 23:11:52 +02:00
Max Kellermann
e81b089612
MusicPipe: automatically clear in destructor
...
We can implement this now that we have a MusicBuffer reference.
2018-06-22 23:09:13 +02:00
Max Kellermann
9f14e7a98d
MusicPipe: add MusicBuffer reference
...
This tiny amount of overhead allows omitting the MusicBuffer in
Clear().
2018-06-22 22:59:44 +02:00
Max Kellermann
66a1e8b737
release v0.20.20
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlsD85IQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEm5xD/oCagsybi2L60r0trtjE7DJ+SnmgbjVmn3z
aieaIA78KFK2QWUettevYkVwtwqEqyw5DwSDmxRRpm9sMKsdDBL+gLCf5hjIFNQY
dZjyBIABgE+aAT+iYeXVmWgJI24s8znEGhZjUG5P/gf+CoLKvN5OQiZoBKOaurjX
YwJUyLV1SXiMLV/4HtOFw4xORuRPflhZ5MnA+cO7BmpV0XQoq82XgBi3XqAB8dv4
cIpDs0MU7DFHNUYHeHEWXVh1PgAcr2madWwQTiscuy8KRAR0GzkCsG5UrSyJs0xH
c0yQ1vVt7X0nyxV35Yemmlfe4DwMwNK9avsTr3Mmr4tNDbxxhiddDYZzy6UJHKis
vaVLhePLjXCOfPRivCY8zVZHwGTO5ArxQqftkGDnM1Gq8PwpTWLimZkvUW35d/xf
SJ+ixpkA1O2DzmkyUam41phhXli+lt0hF1P/7dKsuV/fzmAkJlmRpgxJJhLH8mwq
NNfHk8y8kdGoVy65e/u2asJe8PPB2y9NK2JmbBR9g6Dn+6puP4gkhok3a9cvUZ6q
5GHJF9yRYswVkr/Y6q8UtESeEUczqrQTasVvq0fkxV0f17BKDbOxClb+ItrnPTWV
WMfsyF3TYrHi4piB810q/nBY6pY7R2vQNCPMZwfjGlqn5amR2fm8QWecJVIPpkv3
rEPv+4r8nQ==
=DEYg
-----END PGP SIGNATURE-----
Merge tag 'v0.20.20'
release v0.20.20
2018-05-22 12:47:11 +02:00
Max Kellermann
c76f4ac89b
player/Thread: pause all outputs in single mode
...
This mostly affects the Pulse output plugin which needs to "cork" the
stream (closes #278 ).
2018-05-12 14:44:07 +02:00
Max Kellermann
43a43c1e2b
release v0.20.19
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlriEvAQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEnEpD/4+yH4ydc9l1/j5AD08jFyUUe6YSnC8gLsG
DRrSOU1BQltYAPhlRGxA/HlKxboaT7v5qcXBdIV+HwKs6149j8qxip8g8PYoUBmB
mn6YckjEPCLpLe4WSvfGdm5a1aI7nMC76wHBvTPCAMTZk9FAmUED4DqgNYmWycOd
MpXZbzZdvb2Ti4dQARrK8AbMjTD44LXDOhBgWYnZLpo1ovYhnGvTPAElCQN23tbT
VMcJPYe86lzgs1vWwgURzkn7Y3CaSMF3G+aKw/oLEK3giZmE0y7Kov9Ycy4IC6+3
aXuEP9drMIltAyZ2hmeH6JFigbgQbDhwuAu1biYLLukwa0oEOEFTP1+yxAVbi/vx
58rD6uWJeFbqPna6146TAYVi8QeymJWfhFWxkcol2u7etrIxXpX//qo8Mv+AiLor
wOrTerKgRFYmtSH14wIoSfKsn2wmsXOhDE38h621PAzqvQXDzrBLMo4HMJ4y+G+q
Y6LZWatweL6I2qMsOKWvECOJNxQJrkDFOLq8Mj+O4v6iiLQWhiul1hi2g8EOcRMI
SkdWTakla3LbmuUN1dKQJwoojNevnP5yPXI15rM6JMZkXJcWxi4mvnzoAFnBTmov
57GxpShueo2yy9yrFgS7hBuRsBXzYxze/xY0LSYSO4SjCjNCnWXse6O9pI7JqFbI
m5JJW96Nqg==
=1wwq
-----END PGP SIGNATURE-----
Merge tag 'v0.20.19'
release v0.20.19
2018-04-26 20:06:41 +02:00
Max Kellermann
44b200240f
player/Thread: never reuse decoder when switching radio streams
...
When switching to another song manually, the player checks if the
decoder is already decoding that song; if so, it will attempt to reuse
it by seeking it to the new position. That however fails if the
decoder is not seekable (e.g. a radio stream) which leaves the user
unable to switch to that song with the bogus error message "Not
seekable".
2018-04-25 21:19:26 +02:00
Patryk Hachuła
1628d801f9
playlist/Queue: add one-shot to single mode
2018-02-25 09:50:03 +01:00
Max Kellermann
73ddbcc876
player/Thread: wake up the main thread after failed seek
...
Fixes deadlock bug. Closes #210
2018-02-03 19:28:39 +01:00
Max Kellermann
db379c6172
player/Thread: remove bogus "noexcept" from play_chunk()
...
Closes #203
2018-01-24 11:21:28 +01:00
Max Kellermann
efb528f979
player/Thread: wake up the decoder when the pipe has run empty
...
This is another instance of the kludge we already have a few lines
above that. It works around a deadlock/race condition revealed by
commit 98a7c62d7a
2018-01-12 14:33:22 +01:00
Max Kellermann
8649ea3d6f
thread/Thread: use BoundMethod
2018-01-07 17:20:26 +01:00
Max Kellermann
98a7c62d7a
player/Thread: don't send silence if decoder is slow
...
The output plugin shall decide whether to insert silence or do nothing
at all. The ALSA output plugin has already implemented this.
Inserting silence is not necessary or helpful for some plugins, and
may even hurt them (e.g. "recorder").
2018-01-03 17:36:41 +01:00
Max Kellermann
859e59262e
player/Thread: remove unnecessary "continue" keywords
2018-01-03 17:17:22 +01:00
Max Kellermann
ec113420f1
player/Thread: hold mutex while calling SongBorder()
...
Eliminates unnecessary mutex locks.
2018-01-03 17:12:21 +01:00
Max Kellermann
7171e23700
player/Thread: make seeking into a new song non-blocking
2017-12-30 11:31:26 +01:00
Max Kellermann
dee378b775
player/Thread: make SEEK (partially) non-blocking
...
When the decoder is still starting up while we handle a SEEK, finish
the "player SEEK" immediately and re-enter the player loop, being able
to handle commands (and even cancel the pending seek).
This is the first part in a series of patches to solve the "blocking
input blocks decoder, blocks player, blocks the main thread" problem.
There are many other blocking code locations left, and the main thread
isn't non-blocking either because it waits for "seeking" to become
false.
2017-12-29 17:32:12 +01:00
Max Kellermann
c40354bbcb
player/Outputs: abstract interface wrapping class MultipleOutputs
2017-12-29 16:39:05 +01:00
Max Kellermann
e31abe6d6b
player/Thread: remove redundant outputs.Cancel() call
...
The STOP, EXIT and CLOSE_AUDIO commands are not finished here; they
are propagated to PlayerControl::RunThread() where the
outputs.Cancel() call will be done again.
2017-12-28 08:39:48 +01:00
Max Kellermann
e1349ccadc
player/Thread: ProcessCommand() returns bool
...
Allows signalling a failed seek, and replaces several redundant
command checks after the ProcessCommand() call.
2017-12-28 08:30:01 +01:00
Max Kellermann
8838bdc1e3
player/Thread: move CommandFinished() call out of SeekDecoder(SongTime)
...
Decouple this function from player command execution.
2017-12-27 14:28:56 +01:00
Max Kellermann
d6386bc80f
player/Thread: update code comment
2017-12-27 14:26:14 +01:00
Max Kellermann
6439727afc
player/Thread: use std::lock_guard in RunThread()
2017-12-22 09:35:31 +01:00
Max Kellermann
27b0a581a6
player/Thread: even more fine-grained unlocking
...
Use one single std::lock_guard in Run(), and replace the manual
Lock()/Unlock() calls.
2017-12-22 08:09:16 +01:00
Max Kellermann
15a54230f1
player/Thread: move unlock call down
...
Eliminate more unlock/lock transitions, making the code more robust.
2017-12-22 01:14:51 +01:00
Max Kellermann
f0d184884a
player/Thread: remove obsolete commented code
2017-12-22 01:14:39 +01:00
Max Kellermann
8fca04f140
player/Thread: add missing lock for StartDecoder()
...
Regression from commit 0772e571b7
2017-12-22 01:12:15 +01:00
Max Kellermann
3b2b5edd26
player/Thread: move mutex lock out of SeekDecoder()
2017-12-22 01:07:13 +01:00
Max Kellermann
5bd1fbb0d6
player/Thread: merge four mutex locks in SeekDecoder()
2017-12-22 01:04:44 +01:00
Max Kellermann
0772e571b7
player/Thread: move mutex lock out of StartDecoder()
2017-12-22 01:03:12 +01:00
Max Kellermann
910496cea9
decoder/Control: caller must lock mutex for Start()
2017-12-22 01:03:01 +01:00
Max Kellermann
739e1da279
player/Thread: move mutex lock out of ActivateDecoder()
2017-12-22 00:58:57 +01:00
Max Kellermann
08b4a7aaf2
player/Thread: eliminate LockWaitDecoderStartup()
2017-12-22 00:58:42 +01:00
Max Kellermann
1f0770ca55
player/Thread: move code to SeekDecoder(SongTime)
2017-12-22 00:49:21 +01:00
Max Kellermann
505d0bfa51
player/Thread: move mutex lock out of StopDecoder()
2017-12-22 00:48:19 +01:00
Max Kellermann
860d13c7d8
decoder/Control: caller must lock mutex for Stop()
2017-12-22 00:48:12 +01:00
Max Kellermann
76d77af0f0
player/Thread: use std::lock_guard once more
2017-12-22 00:47:36 +01:00
Max Kellermann
ea8ab4ddf2
player/Thread: merge two mutex locks
2017-12-22 00:42:10 +01:00
Max Kellermann
4bcc38c749
player/Thread: move mutex lock out of WaitDecoderStartup()
2017-12-22 00:41:05 +01:00
Max Kellermann
5becffbba5
player/Thread: merge two mutex locks
2017-12-22 00:39:54 +01:00
Max Kellermann
d0194a6fb3
decoder/Control: caller must lock mutex for Seek()
2017-12-22 00:37:25 +01:00
Max Kellermann
e45d13d469
player/Thread: add missing mutex lock around PlayerControl::SetError()
2017-12-22 00:35:18 +01:00
Max Kellermann
a431274b32
player/Control: add "occupied" flag to skip REFRESH
...
Reduces main thread contention. Avoids blocking the main thread in
"status" commands.
2017-12-21 10:25:40 +01:00
Max Kellermann
b2670eaba5
player/Thread: move start_time variable into the scope
2017-12-20 19:15:28 +01:00
Max Kellermann
54aff33118
player/Thread: reorder attributes to reduce padding
2017-12-20 18:43:56 +01:00
Max Kellermann
25fa3ccade
MusicChunk, player/Thread: use std::unique_ptr<Tag>
2017-12-20 15:02:14 +01:00
Max Kellermann
4286f55c52
player/Thread: use C++11 initializers
2017-12-20 13:35:07 +01:00