aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* aac: make adtsParse() voidMax Kellermann2008-08-261-3/+1
| | | | | adtsParse() always returns 1, and its caller does not use the return value.
* aac: use size_tMax Kellermann2008-08-261-6/+6
|
* aac: removed unused initAacBuffer() parametersMax Kellermann2008-08-261-9/+3
| | | | | Since we eliminated the parameters retFileread and retTagsize in all callers, we can now safely remove it from the function prototype.
* eliminate unused variables in the AAC decoderMax Kellermann2008-08-261-10/+2
|
* added InputStream.readyMax Kellermann2008-08-265-0/+19
| | | | | | | The flag "ready" indicates whether the input stream is ready and it has parsed all meta data. Previously, it was impossible for decodeStart() to see the content type of HTTP input streams, because at that time, the HTTP response wasn't parsed yet.
* added decoder_plugin_register()Max Kellermann2008-08-263-2/+16
| | | | | | | With the functions decoder_plugin_register() and decoder_plugin_unregister(), decoder plugins can register a "secondary" plugin, like the flac input plugin does this for "oggflac".
* don't call quitDecode() in waitOnDecode()Max Kellermann2008-08-261-2/+3
| | | | | To make the code more consistent, call quitDecode() only at the end of decodeParent().
* moved code to player_thread.cMax Kellermann2008-08-267-450/+495
| | | | | Move code which runs in the player thread to player_thread.c. Having a lot of player thread code in decode.c isn't easy to understand.
* moved code to crossfade.cMax Kellermann2008-08-264-49/+108
| | | | | | decode.c should be a lot smaller; start by moving all code which handles cross-fading to crossfade.c. Also includes camelCase conversion.
* added inline function audio_format_time_to_size()Max Kellermann2008-08-262-1/+6
| | | | | Make the code more readable by hiding big formulas in an inline function with a nice name.
* pass max_chunks to calculateCrossFadeChunks()Max Kellermann2008-08-261-7/+8
| | | | | Make calculateCrossFadeChunks() more generic and portable by eliminating global variable access.
* converted MpdTagItem.type to an enumMax Kellermann2008-08-265-22/+28
| | | | | Don't use CPP macros when you can use C enum... this also allows better type checking.
* renamed functions in decoder_list.hMax Kellermann2008-08-266-36/+40
| | | | InputPlugin to decoder_plugin, and no camelCase.
* no camel case in struct decoder_pluginMax Kellermann2008-08-265-39/+41
|
* renamed the InputPlugin function typesMax Kellermann2008-08-261-14/+13
| | | | Continuing the effort to rename InputPlugin to decoder_plugin...
* renamed inputPlugin.* to decoder_list.*Max Kellermann2008-08-267-7/+7
| | | | | Since inputPlugin.c manages the list of registered decoders, we should rename the source file.
* moved decoder externs to inputPlugin.cMax Kellermann2008-08-262-11/+11
| | | | | The decoder_plugin instances are only used inputPlugin.c, so move them from the header file.
* renamed InputPlugin to struct decoder_pluginMax Kellermann2008-08-2618-59/+65
| | | | | | "decoder plugin" is a better name than "input plugin", since the plugin does not actually do the input - InputStream does. Also don't use typedef, so we can forward-declare it if required.
* no busy-waiting for the player processMax Kellermann2008-08-261-2/+3
| | | | | The function player_command() inherited the busy-waiting algorithm from the old code; throw in a wait_main_task() to do idle waiting.
* converted PlayerControl.state to enumMax Kellermann2008-08-262-6/+11
| | | | | Don't write CPP when you can express the same in C... macros vs enum is a good example for that.
* added PlayerControl.commandMax Kellermann2008-08-264-77/+93
| | | | | | | PlayerControl.command replaces the old attributes play, stop, pause, closeAudio, lockQueue, unlockQueue, seek. The main thread waits for each command synchronously, so there can only be one command enabled at a time anyway.
* eliminate OUTPUT_BUFFER_DC_STOP, OUTPUT_BUFFER_DC_SEEKMax Kellermann2008-08-265-23/+20
| | | | | (Ab)use the decoder_command enumeration, which has nearly the same values and the same meaning.
* added decoder_get_url()Max Kellermann2008-08-263-1/+8
| | | | | | The wavpack decoder plugin implements a hack, and it needs the song URL for that. This API (and the hack) should be revised later, but add that function for now.
* don't set dc->seekable in wavpack pluginMax Kellermann2008-08-261-2/+0
| | | | dc->seekable is already set by decodeStart().
* use a local "initialized" flag instead of dc->stateMax Kellermann2008-08-263-5/+11
| | | | | | Since we want to hide mpd internals from the decoder plugins, the plugins should not check dc->state whether they have already called decoder_initialized(). Use a local variable to track that.
* added decoder_seek_where() and decoder_seek_error()Max Kellermann2008-08-2612-42/+60
| | | | | Provide access to seeking for the decoder plugins; they have to know where to seek, and they need a way to tell us that seeking has failed.
* added decoder_command_finished() to decoder_api.hMax Kellermann2008-08-2614-33/+34
| | | | | | | Some decoder commands are implemented in the decoder plugins, thus they need to have an API call to signal that their current command has been finished. Let them use the new decoder_command_finished() instead of the internal dc_command_finished().
* added decoder_get_command()Max Kellermann2008-08-2613-59/+74
| | | | | | Another big patch which hides internal mpd APIs from decoder plugins: decoder plugins regularly poll dc->command; expose it with a decoder_api.h function.
* moved convState to struct decoderMax Kellermann2008-08-264-7/+10
| | | | | | Since we moved all PCM conversions to decoder_data(), the attribute convState isn't being used anymore by the OutputBuffer code. Move it to struct decoder.
* moved struct AudioFormat to audio_format.hMax Kellermann2008-08-2613-19/+48
| | | | | We want to expose the AudioFormat structure to plugins; remove some clutter by moving its declaration to a separate header file.
* moved InputPlugin to decoder_api.hMax Kellermann2008-08-266-61/+64
| | | | | | InputPlugin is the API which is implemented by a decoder plugin. This belongs to the public API/ABI, so move it to decoder_api.h. It will later be renamed to something like "decoder_plugin".
* remove one indent level from audiofile pluginMax Kellermann2008-08-261-30/+25
| | | | | Anonymous code blocks just to declare variables look ugly. Move the variable declarations up and disband the code block.
* use break instead of local variable "eof"Max Kellermann2008-08-261-16/+12
| | | | | Similar to previous patch: eliminate one variable by using "break". This also simplifies the code since we can remove one level of indent.
* removed local variable "eof" because it is unusedMax Kellermann2008-08-262-19/+9
| | | | | "break" is so much easier than "eof=1; continue;", when "!eof" is the loop condition.
* simplify several dc->command checksMax Kellermann2008-08-261-7/+3
| | | | | | Since we have merged dc->stop, dc->seek into one variable, we don't have to check both conditions at a time; we can replace "!stop && !seek" with "none".
* added parameter total_time to decoder_initialized()Max Kellermann2008-08-2614-29/+31
| | | | | Similar to the previous patch: pass total_time instead of manipulating dc->totalTime directly.
* added audio_format parameter to decoder_initialized()Max Kellermann2008-08-2614-83/+88
| | | | | | dc->audioFormat is set once by the decoder plugins before invoking decoder_initialized(); hide dc->audioFormat and let the decoder pass an AudioFormat pointer to decoder_initialized().
* added decoder_clear() and decoder_flush()Max Kellermann2008-08-2612-22/+35
| | | | | | We are now beginning to remove direct structure accesses from the decoder plugins. decoder_clear() and decoder_flush() mask two very common buffer functions.
* tail_chunk() returns ob_chunk pointerMax Kellermann2008-08-261-8/+6
| | | | | | Code simplification: since we are not using in-band signalling with the chunk index anymore, we can just return a pointer to the tail chunk instead of the index.
* added OutputBuffer.notifyMax Kellermann2008-08-263-5/+9
| | | | | | | | OutputBuffer should be a more generic low-level library, without dependencies to the other headers. This patch adds the field "notify", which is used to signal the player thread. It is passed in the constructor, and removes the need to compile with the decode.h header.
* added decoder_data()Max Kellermann2008-08-2613-136/+177
| | | | | Moved all of the player-waiting code to decoder_data(), to make OutputBuffer more generic.
* use the notify library in main_notify.cMax Kellermann2008-08-261-10/+7
| | | | Avoid some duplicated code in main_notify.c.
* do not sleep after openAudioDevice()Max Kellermann2008-08-261-3/+0
| | | | | | After the decoder has been initialized and the audio device has been opened, don't sleep. The decoder plugin won't do anything special nor will it care to wake us up for some reason.
* added decoder_initialized()Max Kellermann2008-08-2614-31/+66
| | | | | | | decoder_initialized() sets the state to DECODE_STATE_DECODE and wakes up the player thread. It is called by the decoder plugin after its internal initialization is finished. More arguments will be added later to prevent direct accesses to the DecoderControl struct.
* added struct decoderMax Kellermann2008-08-2617-30/+121
| | | | | | The decoder struct should later be made opaque to the decoder plugin, because maintaining a stable struct ABI is quite difficult. The ABI should only consist of a small number of stable functions.
* invoke the notify API directlyMax Kellermann2008-08-265-62/+24
| | | | | | Don't use wrappers like player_wakeup_decoder_nb(). These have been wrappers calling notify.c functions, for compatibility with the existing code when we migrated to notify.c.
* removed "else"Max Kellermann2008-08-261-2/+3
| | | | | The "if" block breaked out of the loop. That means we can move the code out of the "else" block.
* added dc_command_finished()Max Kellermann2008-08-2613-34/+32
| | | | | | | | dc_command_finished() is invoked by the decoder thread when it has finished a command (sent by the player thread). It resets dc.command and wakes up the player thread. This combination was used at a lot of places, and by introducing this function, the code will be more readable.
* don't busy wait for the decoder threadMax Kellermann2008-08-261-3/+7
| | | | | | | Busy wait loops are a bad thing, especially when the response time can be very long - busy waits eat a lot of CPU, and thus slow down the other thread. Since the other thread will notify us when it's ready, we can use notify_wait() instead.
* merged start, stop, seek into DecoderControl.commandMax Kellermann2008-08-2615-108/+139
| | | | | | | Much of the existing code queries all three variables sequentially. Since only one of them can be set at a time, this can be optimized and unified by merging all of them into one enum variable. Later, the "command" checks can be expressed in a "switch" statement.