Commits
- Commit:
b9d2a697d18a2b6994f7b611145e7b085a5de49d
- From:
- Omar Polo <op@omarpolo.com>
- Date:
bits, rate and channels are unsigned
match the struct sio_par
- Commit:
ae335651f8a91f929ca576e1e3e3e2a5ba780059
- From:
- Omar Polo <op@omarpolo.com>
- Date:
declare local functions as static
- Commit:
ff06024f86fb68ea11b030f669b162794eb5bc19
- From:
- Omar Polo <op@omarpolo.com>
- Date:
keep track of current position and total duration
- Commit:
17ef54d6ac6c34b0b1370c1c57836322702783e1
- From:
- Omar Polo <op@omarpolo.com>
- Date:
improving error reporting
makes the player process optionally send back a string describing the
failure to provide a better and more coincise error message.
This turns the syslog message(s):
amused: unknown file type
amused: failed to play, skipping /home/op/pics/phos.jpg
into:
amused: unknown file type; skipping /home/op/pics/phos.jpg
- Commit:
f523773656c7fb53c7ec2f373fb48da5c2f1d788
- From:
- Omar Polo <op@omarpolo.com>
- Date:
don't sio_start if we're not stopped
- Commit:
463ce8791b0da705a2cfd040324fc8dd3c2fd9b9
- From:
- Omar Polo <op@omarpolo.com>
- Date:
don't POLLIN, we only care about POLLOUT
- Commit:
4d8a06d41dc96cb9b17dcbf3a20477dfb5566b82
- From:
- Omar Polo <op@omarpolo.com>
- Date:
don't change params if they're the same
avoids a sio_stop in the common case of switching from song that needs
similar params (such as tracks in the same album.)
- Commit:
aecca17ce0a487ea94b7e3f0c8e5387c1fce31e7
- From:
- Omar Polo <op@omarpolo.com>
- Date:
inline player_init
- Commit:
c0180200175f649dcb6bd4214a7d55a89bccab8c
- From:
- Omar Polo <op@omarpolo.com>
- Date:
switch to a non-blocking usage of sndio
- Commit:
fd90976c2bb3674cfbf4ffd5ad0fcec51a64da18
- From:
- Omar Polo <op@omarpolo.com>
- Date:
free the imsg in player after handling, plugs a memory leak
- Commit:
6e4f8947cd1b33dc0004236e614d704377353f24
- From:
- Omar Polo <op@omarpolo.com>
- Date:
inline player_enqueue
- Commit:
ee5ab27dda2f3da5cd6a38ec0d4d4c9e6a5b6c48
- From:
- Omar Polo <op@omarpolo.com>
- Date:
s/audio_init/player_init
was the only function to disrespect the player_* namespace (well,
excepting play). while here also don't mark those two as static, they
were the only static functions in the file. I'm not trying to
enforcing private symbols here.
- Commit:
7850bef5851db3b13284bfaae7cede92b8450aff
- From:
- Omar Polo <op@omarpolo.com>
- Date:
no need to sio_setpar during initialization
we don't know what format the music will be so we have to stop and set
the parameters in player_setup. there's no point in setting bogus
parameter in audio_init.
- Commit:
926ee8364e8c83d7a22dcd5bceb65e235486703a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
consume all enqueued messages before calling imsg_read
player_dispatch reads only one imsg from the ibuf. Next time it's
called, the other messages on the ibuf (if any) are discarded and new
ones are read. This can cause the player process to go out-of-sync with
the main process if multiple messages were "bundled" in the same chunk.
To avoid this, always try to imsg_read before. If it succeedes, we read
process the equeued messages one by one, if it fails then we poll for
new data and call imsg_read to process them and retry.
This fixes a bug where amused could be "confused" by running
$ amused pause ; amused stop ; amused play
in a loop a few times. This bug and the repro were reported two months
ago by Dirk-Wilhelm Peters, thanks! (and sorry it took so long to
understand and fix the issue)
- Commit:
fc4a38afafeec3a23f264e76659b3405d2d7cc48
- From:
- Omar Polo <op@omarpolo.com>
- Date:
don't set the imsg fd as blocking mode
just do a poll before imsg_read in player_disptach to wait for data to
read. It's not performance-critical code, so this is fine.
If it were important not to do an extra poll(2), for example when we're
called is called after player_pendingimsg we already know there's
something to read, we could move the polling in the case `n == 0' below.