aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/oggflac_plugin.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-09-29flac: removed FlacData.chunk_lengthMax Kellermann1-1/+0
chunk_length can be converted to a local variable, because it is always reset to 0 after it was used.
2008-09-29flac: moved code from flacWrite() to _flac_common.cMax Kellermann1-43/+1
There is still a lot of duplicated code in flac_plugin.c and oggflac_plugin.c. Move code from flac_plugin.c to _flac_common.c, and use the new function flac_common_write() also in oggflac_plugin.c, porting lots of optimizations over to it.
2008-09-02tag: fix the shout and oggflac pluginsMax Kellermann1-1/+3
During the tag library refactoring, the shout plugin was disabled, and I forgot about adapting it to the new API. Apply the same fixes to the oggflac decoder plugin.
2008-09-02tag: renamed MpdTag and MpdTagItem to struct mpd_tag, struct tag_itemMax Kellermann1-1/+1
Getting rid of CamelCase; not having typedefs also allows us to forward-declare the structures.
2008-08-31oggflac: fix GCC warningsMax Kellermann1-9/+9
Fix lots of "unused parameter" warnings in the OggFLAC decoder plugin. Not sure if anybody uses it anymore, since newer libflac obsoletes it.
2008-08-30oggvorbis: don't detect OGG header if stream is not seekableMax Kellermann1-0/+5
If the input stream is not seekable, the try_decode() function consumes valuable data, which is not available to the decode() function anymore. This means that the decode() function does not parse the header correctly. Better skip the detection if we cannot seek. Or implement better buffering, something like unread() or buffered rewind().
2008-08-30clean up CPP includesMax Kellermann1-6/+0
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]
2008-08-16core rewrite (decode,player,outputBuffer,playlist)Eric Wong1-28/+27
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.
2008-06-01oggflac_plugin: fix build with libOggFLAC lib (libFLAC <= 7)Eric Wong1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@7370 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13Make the OutputBuffer API more consistentEric Wong1-2/+2
We had functions names varied between outputBufferFoo, fooOutputBuffer, and output_buffer_foo That was too confusing for my little brain to handle. And the global variable was somehow named 'cb' instead of the more obvious 'ob'... git-svn-id: https://svn.musicpd.org/mpd/trunk@7355 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13Stop passing our single OutputBuffer object everywhereEric Wong1-4/+4
All of our main singleton data structures are implicitly shared, so there's no reason to keep passing them around and around in the stack and making our internal API harder to deal with. git-svn-id: https://svn.musicpd.org/mpd/trunk@7354 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13Stop passing our single DecoderControl object everywhereEric Wong1-16/+15
This at least makes the argument list to a lot of our plugin functions shorter and removes a good amount of line nois^W^Wcode, hopefully making things easier to read and follow. git-svn-id: https://svn.musicpd.org/mpd/trunk@7353 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12Initial cut of fork() => pthreads() for decoder and playerEric Wong1-0/+1
I initially started to do a heavy rewrite that changed the way processes communicated, but that was too much to do at once. So this change only focuses on replacing the player and decode processes with threads and using condition variables instead of polling in loops; so the changeset itself is quiet small. * The shared output buffer variables will still need locking to guard against race conditions. So in this effect, we're probably just as buggy as before. The reduced context-switching overhead of using threads instead of processes may even make bugs show up more or less often... * Basic functionality appears to be working for playing local (and NFS) audio, including: play, pause, stop, seek, previous, next, and main playlist editing * I haven't tested HTTP streams yet, they should work. * I've only tested ALSA and Icecast. ALSA works fine, Icecast metadata seems to get screwy at times and breaks song advancement in the playlist at times. * state file loading works, too (after some last-minute hacks with non-blocking wakeup functions) * The non-blocking (*_nb) variants of the task management functions are probably overused. They're more lenient and easier to use because much of our code is still based on our previous polling-based system. * It currently segfaults on exit. I haven't paid much attention to the exit/signal-handling routines other than ensuring it compiles. At least the state file seems to work. We don't do any cleanups of the threads on exit, yet. * Update is still done in a child process and not in a thread. To do this in a thread, we'll need to ensure it does proper locking and communication with the main thread; but should require less memory in the end because we'll be updating the database "in-place" rather than updating a copy and then bulk-loading when done. * We're more sensitive to bugs in 3rd party libraries now. My plan is to eventually use a master process which forks() and restarts the child when it dies: locking and communication with the main thread; but should require less memory in the end because we'll be updating the database "in-place" rather than updating a copy and then bulk-loading when done. * We're more sensitive to bugs in 3rd party libraries now. My plan is to eventually use a master process which forks() and restarts the child when it dies: master - just does waitpid() + fork() in a loop \- main thread \- decoder thread \- player thread At the beginning of every song, the main thread will set a dirty flag and update the state file. This way, if we encounter a song that triggers a segfault killing the main thread, the master will start the replacement main on the next song. * The main thread still wakes up every second on select() to check for signals; which affects power management. [merged r7138 from branches/ew] git-svn-id: https://svn.musicpd.org/mpd/trunk@7240 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12use unsigned integers in the flac pluginMax Kellermann1-1/+1
The counter variables c_samp and c_chan begin at zero and can never be negative. git-svn-id: https://svn.musicpd.org/mpd/trunk@7228 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12removed unused variableMax Kellermann1-3/+3
The local variable d_samp is initialized, but never actually used. git-svn-id: https://svn.musicpd.org/mpd/trunk@7227 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-03-20inputPlugins: add .oga suffix support for Ogg containersEric Wong1-1/+1
From <http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions>: > .oga - audio/ogg > > * Ogg Audio Profile (audio in Ogg container) > * Applications supporting .oga, .ogv SHOULD support decoding > from muxed Ogg streams > * Covers Ogg FLAC, Ghost, and OggPCM > * Although they share the same MIME type, Vorbis and Speex > use different file extensions. > * SHOULD contain a Skeleton logical bitstream. > * Vorbis and Speex may use .oga, but it is not the > prefered(sic) method of distributing these files because of > backwards-compatibility issues. Thanks to Qball and Rasi for the patch. git-svn-id: https://svn.musicpd.org/mpd/trunk@7191 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-02-05fix -Wconst warningsMax Kellermann1-5/+5
[ew: cleaned up the dirty union hack a bit] Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-03Cleanup #includes of standard system headers and put them in one placeEric Wong1-4/+1
This will make refactoring features easier, especially now that pthreads support and larger refactorings are on the horizon. Hopefully, this will make porting to other platforms (even non-UNIX-like ones for masochists) easier, too. os_compat.h will house all the #includes for system headers considered to be the "core" of MPD. Headers for optional features will be left to individual source files. git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-01Simplify decode cleanup logic a bitEric Wong1-8/+4
DECODE_STATE_STOP is always set as dc->state, and dc->stop is always cleared. So handle it in decodeStart once rather than doing it in every plugin. While we're at it, fix a long-standing (but difficult to trigger) bug in mpc_decode where we failed to return if mpc_decoder_initialize() fails. git-svn-id: https://svn.musicpd.org/mpd/trunk@7122 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-05The massive copyright updateAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14Don't initialize globals to zero (or NULL)Eric Wong1-12/+1
Some compilers and linkers aren't smart enough to optimize this, as global variables are implictly initialized to zero. As a result, binaries are a bit smaller as more goes in the .bss and less in the text section. git-svn-id: https://svn.musicpd.org/mpd/trunk@5254 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14flac/ogg/oggflac: keep old mime-types in addition to the new onesEric Wong1-1/+4
We'll be dealing with legacy server configurations for a long time to come. git-svn-id: https://svn.musicpd.org/mpd/trunk@5253 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-06Fix the mime types for flac & oggflac, see mantis bug #1423 for more informationAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5222 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-12-04Introduce backwards compatibility with pre-1.1.3 FLACEric Wong1-4/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5111 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-20trivial: labels should be on the left-most column, no tabbingEric Wong1-2/+2
Unfortunately there doesn't seem to be an indent switch for this, but we have find + perl: find src -name '*.[ch]' | xargs perl -i -p -e \ 's/^\s+(\w+):/$1:/g unless /^\s+default:/' This is a followup to r4605, and there are no actual code changes in this. git-svn-id: https://svn.musicpd.org/mpd/trunk@4661 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-4/+4
Add a few new options for indent to try to make things a bit cleaner git-svn-id: https://svn.musicpd.org/mpd/trunk@4411 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-149/+158
Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-18inputPlugins/oggflac_plugin.c: remove unused varEric Wong1-1/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@4389 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-14Change shank's email addressJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-13Huge header update, update the copyright and addAvuton Olrich1-1/+1
the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-03-16merge with mpd/trunk up to r3925Eric Wong1-0/+426
git-svn-id: https://svn.musicpd.org/mpd/trunk@3926 09075e82-0dd4-0310-85a5-a0d7c8717e4f