| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When checking for EOF, we should not check whether the read request
has been fully satisified. The InputStream API does not guarantee
that readFromInputStream() always fills the whole buffer, if EOF is
not reached. Since there is the function inputStreamAtEOF() dedicated
for this purpose, we should use it for EOF checking after
readFromInputStream()==0.
|
| |
| |
| |
| |
| |
| | |
Fill the AacBuffer even when nothing has been consumed yet. The
function should not check for consumed data, but for free space at the
end of the buffer.
|
| |
| |
| |
| |
| | |
Return instead of putting all the code into a if-closure. That saves
one level of indentation.
|
| |
| |
| |
| |
| | |
adtsParse() always returns 1, and its caller does not use the return
value.
|
| | |
|
| |
| |
| |
| |
| | |
Since we eliminated the parameters retFileread and retTagsize in all
callers, we can now safely remove it from the function prototype.
|
| | |
|
| |
| |
| |
| |
| | |
Make the code more readable by hiding big formulas in an inline
function with a nice name.
|
| |
| |
| |
| |
| | |
Don't use CPP macros when you can use C enum... this also allows
better type checking.
|
| |
| |
| |
| |
| | |
We want to expose the AudioFormat structure to plugins; remove some
clutter by moving its declaration to a separate header file.
|
| |
| |
| |
| |
| | |
Anonymous code blocks just to declare variables look ugly. Move the
variable declarations up and disband the code block.
|
| |
| |
| |
| |
| |
| |
| | |
Similar to previous patch: eliminate one variable by using "break".
This also simplifies the code since we can remove one level of indent.
[ew: rewritten to match current API]
|
| |
| |
| |
| |
| | |
"break" is so much easier than "eof=1; continue;", when "!eof" is the
loop condition.
|
| |
| |
| |
| |
| |
| |
| | |
Include only headers which are really required. This speeds up
compilation and helps detect cross-layer accesses.
[ew: minor fixups to not break on new core]
|
| |
| |
| |
| |
| |
| | |
Also enable -Wunused-parameter - this forces us to add the gcc
"unused" attribute to a lot of parameters (mostly library callback
functions), but it's worth it during code refactorizations.
|
| |
| |
| |
| | |
Previously, it was not possible to check for e.g. "-std=c99".
|
| |
| |
| |
| |
| | |
Fix a "unused argument" warning, and several warnings regarding void
pointer calculation.
|
| |
| |
| |
| |
| |
| |
| | |
Using struct iovec means having to cast iov_base everywhere
we want to do pointer arithmetic. Instead, just use rbvec
which can be safely casted to iovec whenever we use
the readv/writev functions.
|
| |
| |
| |
| |
| | |
Fix a "signed/unsigned comparison warning", and several void pointer
math warnings.
|
|/ |
|
|
|
|
|
| |
This avoids writing the metadata of a static song into
the URL of song; leading to confusing looking playlists.
|
|
|
|
|
|
| |
I considered calling it from metadata_pipe_recv() in
the past, but it's not necessary, so just inline it
again to simplify things.
|
|
|
|
|
|
|
|
|
| |
unK reported a bug in which explicitly calling "delete"
on each song would cause mpd to lock up. This is actually
triggered when the only song on the mpd playlist is deleted.
Additionally, add an extra assertion to ensure we play
a valid, non-NULL song in play_order_num().
|
|
|
|
|
|
| |
This way if we previously had a seek error, starting
to play a new song will immediately update the status
metadata.
|
|
|
|
|
|
|
|
|
| |
Hopefully this fixes a segfault I experienced inside
freeMpdTag earlier with the metadata_pipe. I could
not reproduce the segfault again, however.
Regardless, if multiple threads rely on this, we need to
atomically increment/decrement these counters.
|
|
|
|
|
|
|
| |
When we send metadata, there's a remote chance that our pipe is
full and our tag will be silently discarded. If that happens,
the readers will never have a chance to free the tag, so ensure
we free it before returning to the caller.
|
|
|
|
| |
I just forgot to reenable/reinitialize it after the core rewrite.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This has been tested for both playback of streams and
outputting to streams, and seems to work fine with minimal
locking. This reuses the sequence number infrastructure
in OutputBuffer for synchronizing metadata payloads; so
(IMNSHO) should be much more understandable than various
flags being set here and there..
It could still use some cleanup and much testing, but
synchronization issues should be minimal.
|
|
|
|
|
|
|
|
|
|
| |
When deleting previous songs, we forgot to update the
playlist.queue value, causing syncPlaylistWithQueue to
trigger a false sync and screw with the playlist.current
pointer; causing the currentsong command to return
an incorrect song.
Thanks to unK to reporting this bug!
|
|
|
|
|
|
|
|
| |
When moving songs around, we forgot to update the
playlist.queue value, causing syncPlaylistWithQueue to
trigger a false sync and screw with the playlist.current
pointer; causing the currentsong command to return
an incorrect song.
|
|
|
|
|
|
| |
It's possible to calculate an impossibly small value that
we don't have a chance to xfade. Don't die if we can't
find the boundary to start crossfading on
|
|
|
|
|
|
|
| |
ob.xfade_time can be changed by the main process without
locking, so copy the float value into a local variable
and recheck the local variable for zero before
continuing.
|
|
|
|
|
| |
We don't assert on xfade_time > 0 inside any of the xfade
calculations since we have no lock around xfade_time.
|
|
|
|
| |
It sounds nasty and we didn't do it before the core-rewrite
|
| |
|
|
|
|
| |
It's redundant, we already track that stuff elsewhere.
|
|
|
|
|
|
|
| |
This fixes the case where we wouldn't start playing a newly
added song if we're near the end of the playlist and done
decoding the last song (but still playing from the
buffer).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
buffer_before_play is a prebuffer; always respecting it
is almost as good as having no buffer at all. So we only
respect it when we haven't played anything.
Bugs that were a side effect of this also got fixed:
The player would not stop when we got to the end of the last
song on non-repeating playlists. The playlist would
continuously show the song in the last few seconds of
playback, and never move.
Having crossfade enabled would also amplify the above effect.
So, as a side effect, crossfade now correctly handles
end-of-playlist conditions, as well. It will fade out to
silence when we're at the end of a playlist.
|
|
|
|
|
|
|
| |
There are still some places where we try to call this
function without the playlist being stopped. It's really
harmless, to call it and just break out immediately, so
change the assertion.
|
|
|
|
|
|
| |
data->muteFrame won't necessarily get cleared when it
enters that block of code, so we don't signal the action
as complete until it is actually cleared.
|
|
|
|
| |
Hopefully this fixes the skipping problem Qball reports
|
|\
| |
| |
| |
| |
| |
| |
| | |
* 'core-rewrite' of git://git.musicpd.org/normalperson/mpd:
Remove ob_wait_sync and cleanup triggering in playlist
fix output buffer deadlock when daemonizing
log.c: thread-safety for warning log
core rewrite (decode,player,outputBuffer,playlist)
|
| |
| |
| |
| |
| |
| |
| |
| | |
ob_wait_sync was a gross hack anyways. We are one
step closer to being able to trigger actions in our
worker threads asynchronously. Just need to make
input (file opening) in decoder happen _after_ our
decoder returns an ACK.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We spawned the output buffer thread before daemonizing in
initPlayerData(), which is ultra bad because daemonizes forks
and threads are not preserved on exit. Since playerData has
been stripped bare by this core-rewrite anyways, move this code
into the outputBuffer_* group and drop playerData.[ch]
completely
I completely forgot to test this :<
|
| |
| |
| |
| |
| |
| | |
I'm really no fan of the warning log, it's too complex
for how little it gets used; but fixing it is another
problem.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a huge refactoring of the core mpd process. The
queueing/buffering mechanism is heavily reworked.
The player.c code has been merged into outputBuffer (the actual
ring buffering logic is handled by ringbuf.c); and decode.c
actually handles decoding stuff.
The end result is several hundreds of lines shorter, even though
we still have a lot of DEBUG statements left in there for
tracing and a lot of assertions, too.
|
|/
|
|
|
|
|
| |
Warren hasn't been active in development in a while and probably
doesn't have much time to answer user questions. So point the
mailing contact to the public mailing lists where any developer
can see and answer.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Correctly define the following CPP directives:
HAVE_FAAD_BUFLEN_FUNCS
HAVE_MP4AUDIOSPECIFICCONFIG
* link against libwavpack correctly in bs
* fix include path for the mpd config.h for mp4ff
git-svn-id: https://svn.musicpd.org/mpd/trunk@7399 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
| |
git-svn-id: https://svn.musicpd.org/mpd/trunk@7398 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
|
|
| |
If nothing has been read from the input stream, we don't have to
rewind it.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7397 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|