aboutsummaryrefslogtreecommitdiff
path: root/src/decoder_thread.c
Commit message (Collapse)AuthorAge
* mapper: allocate the result of map_directory_child_fs(), map_song_fs()Max Kellermann2009-01-02
| | | | Don't use fixed stack buffers.
* decoder_thread: migrate from pthread to glib threadsThomas Jansen2008-12-28
|
* Include <pthread.h> where it is necessary onlyThomas Jansen2008-12-28
|
* decoder: terminate decoder thread before MPD cleanupMax Kellermann2008-12-28
| | | | | | When MPD exits, it should manually free all resources in use, to allow easy memory leak debugging. Make the decoder thread terminate during that.
* decoder: added missing glib.h includeMax Kellermann2008-11-25
|
* decoder_thread.c: replaced mpd_unused by G_GNUC_UNUSEDThomas Jansen2008-11-24
|
* decoder: ignore the SEEK command during startupMax Kellermann2008-11-20
| | | | | | While waiting for the input stream to become ready, ignore all commands except STOP. This fixes seeking errors with (remote) songs which the decoder has already finished.
* decoder: fixed typo in assertionMax Kellermann2008-11-11
| | | | | decoder_file_decode() should check for plugin->file_decode, not plugin->stream_decode().
* decoder: return void from decode() methodsMax Kellermann2008-11-11
| | | | | | | | The stream_decode() and file_decode() methods returned a boolean, indicating whether they were able to decode the song. This is redundant, since we already know that: if decoder_initialized() has been called (and dc.state==DECODE), the plugin succeeded. Change both methods to return void.
* decoder: removed plugin method try_decode()Max Kellermann2008-11-10
| | | | | | Instead of having a seprate try_decode() method, let the stream_decode() and file_decode() methods decide whether they are able to decode the song.
* decoder: fall back to next pluginMax Kellermann2008-11-10
| | | | When a plugin is unable to decode a song, try the other plugins.
* decoder: wrapper functions for methods stream_decode() and file_decode()Max Kellermann2008-11-10
| | | | Added lots of assertions to the wrapper functions.
* decoder: converted dc.error to a dc.state valueMax Kellermann2008-11-08
| | | | | | The player did not care about the exact error value, it only checked whether an error has occured. This could fit well into decoder_control.state - introduce a new state "DECODE_STATE_ERROR".
* decoder: removed "plugin" from the decoder structMax Kellermann2008-11-08
| | | | decoder.plugin was a write-only attribute.
* decoder: removed stream_typesMax Kellermann2008-11-04
| | | | | Instead of checking the stream_types bit set, we can simply check whether the methods stream_decode() and file_decode() are implemented.
* decoder: update dc.error after input stream failureMax Kellermann2008-11-03
| | | | dc.error wasn't updated when the input stream failed to initialize.
* decoder: no CamelCaseMax Kellermann2008-11-03
| | | | Renamed variables and functions.
* decoder_api: automatically send stream tagMax Kellermann2008-11-03
| | | | | | | | | | If an input stream provides tags (e.g. from an icecast server), send them in the decoder_data() and decoder_tag() methods. Removed the according code from the mp3 and oggvorbis plugins - decoders shouldn't have to care about stream tags. This patch also adds the missing decoder_tag() invocation to the mp3 plugin.
* decoder: rewind input stream after try_decode()Max Kellermann2008-11-02
| | | | | | | | | The try_decode() method may have read some data from the stream, which is now lost. To make this data available to other methods, get it back by rewinding the input stream after each try_decode() invocation. The ogg and wavpack plugins did this manually and inconsistently; this code can now be removed.
* decoder: moved code to decoder_try_decode()Max Kellermann2008-11-02
|
* decoder_api: pass "seekable" flag to decoder_initialized()Max Kellermann2008-11-02
| | | | | | Don't pass the "seekable" flag with every decoder_data() invocation. Since that flag won't change within the file, it is enough to pass it to decoder_initialized() once per file.
* music_pipe: renamed ob_* functions to music_pipe_*Max Kellermann2008-11-02
| | | | Rename all functions to the new prefix.
* renamed outputBuffer.[ch] to pipe.[ch]Max Kellermann2008-11-02
| | | | | | | No CamelCase in the file name. The output_buffer struct is going to be renamed to music_pipe. There are so many buffer levels in MPD, and calling this one "output buffer" is wrong, because it's not the last buffer before the music reaches the output devices.
* decoder: return const decoder_plugin structsMax Kellermann2008-11-01
| | | | | The decoder_plugin structs must never change. Don't work with non-const pointers.
* update: check return valuesMax Kellermann2008-10-31
| | | | | Nearly all mapper functions can fail and will then return NULL. Add checks to all callers.
* decoder: eliminate gotos in decodeStart()Max Kellermann2008-10-31
| | | | http://xkcd.com/292/
* decoder: don't wake up player when command==NONEMax Kellermann2008-10-31
| | | | | If nobody sent a command, the player isn't waiting for the decoder. Don't wake it up.
* decoder: notify player after stopMax Kellermann2008-10-31
| | | | The player should always be woken up when the decoder quits.
* decoder: reset state and command in decoder_task()Max Kellermann2008-10-31
| | | | | Eliminate one goto in decodeStart() by moving some cleanup to decoder_task().
* decoder: introduce switch statement in decoder_task()Max Kellermann2008-10-31
| | | | | switch looks much nicer than if/elseif/... and gcc generates nice warnings when a new command is added to the enum.
* decoder: use bool for return values and flagsMax Kellermann2008-10-30
| | | | | Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
* decoder: automatically flush the output buffer after decoder exitsMax Kellermann2008-10-29
| | | | | | | A decoder_flush() invocation was missing in the FLAC plugin, resulting in casual assertion failures due to a wrong assumption about the last chunk's audio format. It's much easier to remove that decoder_flush() function and make the decoder thread call ob_flush().
* input_stream: use "bool" instead of "int"Max Kellermann2008-10-26
| | | | | For boolean values and success flags, use bool instead of integer (1/0 for true/false, 0/-1 for success/failure).
* input_stream: no CamelCaseMax Kellermann2008-10-26
| | | | Renamed all functions and variables.
* path: removed pathcpy_trunc()Max Kellermann2008-10-20
| | | | There was only one user of pathcpy_trunc(), which can be eliminated.
* input: declare struct input_streamMax Kellermann2008-10-17
| | | | | Provide a struct type which can be forward-declared. The typedef InputStream is deprecated now.
* decoder: notify player after entering decodeStart()Max Kellermann2008-10-17
| | | | | Wake up the player as soon as the decoder thread has entered its loop. This fixes a dead lock when the input is blocking.
* mapper: new song-to-filesystem mapper libraryMax Kellermann2008-10-14
| | | | | | The mapper library maps directory and song objects to file system paths. With this central library, the code mixture in path.c should be cleaned up, and we will be able to add neat features like aliasing.
* song: don't allow calling song_get_url(NULL)Max Kellermann2008-10-08
| | | | | | The runtime check suggests that the author has somehow thought song_get_url(NULL) might be valid. It should not be. Replace it with an assertion.
* song: removed CamelCaseMax Kellermann2008-10-08
| | | | CamelCase is ugly... rename all functions.
* use the "bool" data type instead of "int"Max Kellermann2008-10-08
| | | | "bool" should be used in C99 programs for boolean values.
* song: converted typedef Song to struct songMax Kellermann2008-10-08
| | | | Again, a data type which can be forward-declared.
* decoder: renamed plugin methodsMax Kellermann2008-09-29
| | | | | Why have a "_func" prefix on all method names? Also don't typedef the methods, there is no advantage in that.
* notify: protect notify->pending with the mutexMax Kellermann2008-09-26
| | | | | | | | | | There was a known deadlocking bug in the notify library: when the other thread set notify->pending after the according check in notify_wait(), the latter thread was deadlocked. Resolve this by synchronizing all accesses to notify->pending with the notify object's mutex. Since notify_signal_sync() was never used, we can remove it. As a consequence, we don't need notify_enter() and notify_leave() anymore; eliminate them, too.
* renamed player.c to player_control.cMax Kellermann2008-08-26
| | | | | Give player.c a better name, meaning that the code is used to control the player thread.
* renamed decoderInit() to decoder_thread_start()Max Kellermann2008-08-26
|
* renamed decode.h to decoder_control.hMax Kellermann2008-08-26
|
* renamed decode.c to decoder_thread.cMax Kellermann2008-08-26
It should be obvious in which thread or context a function is being executed at runtime. The code which was left in decode.c is for the decoder thread itself; give the file a better name.