aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_api.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-01-15decoder_api: added G_GNUC_UNUSED attribute to decoder_initialized()Max Kellermann1-1/+1
In NDEBUG, the parameter "decoder" is not used.
2009-01-13decoder_api: don't ignore DECODE_COMMAND_STOPMax Kellermann1-2/+1
When the decoder thread is waiting for free chunks in the music pipe, don't ignore the STOP command. Just return dc.command without further checks.
2009-01-07pcm: added pcm_convert_deinit(), pcm_resample_deinit()Max Kellermann1-2/+0
Free memory allocated by libsamplerate when the output or the decoder is closed.
2009-01-04song: allocate the result of song_get_url()Max Kellermann1-3/+2
2009-01-03input_stream: added tag() methodMax Kellermann1-65/+59
The tag() method reads a tag from the stream. This replaces the meta_name and meta_title attributes.
2009-01-03decoder_api: moved code to do_send_tag(), free temporary tagMax Kellermann1-7/+17
This patch fixes a minor memory leak: when decoder_tag() attempted to send a merged tag object (created by tag_add_stream_tags()), and was interrupted by a decoder command, it did not free the temporary merged tag object.
2009-01-03decoder_api: use GLib instead of utils.hMax Kellermann1-4/+5
2008-12-24pcm_utils: check pcm_convert()==0Max Kellermann1-0/+7
It is illegal to pass an empty audio buffer around. pcm_resample() sometimes seems to result in 0 samples, maybe related to libsamplerate. To work around that problem, add special checks after both pcm_convert() invocations. Removed the pcm_resample()==0 checks from pcm_convert().
2008-11-24decoder_api.c: replaced mpd_unused by G_GNUC_UNUSEDThomas Jansen1-6/+7
2008-11-21decoder: check audio_format_valid() in all decodersMax Kellermann1-0/+1
Refuse to play audio formats which are not supported by MPD.
2008-11-21decoder: ignore decoder_data() calls with length==0Max Kellermann1-1/+2
Pushing buffers with a zero length into the MPD core causes failures; don't let them pass beyond the decoder plugi API.
2008-11-18decoder: pass the correct buffer length to pcm_convert()Max Kellermann1-5/+6
When a global audio format is configured (setting "audio_output_format"), decoder_data() overwrote the "length" parameter with the size of the output buffer (result of pcm_convert_size()). Declare a separate variable for the output buffer length.
2008-11-15decoder: check length==0 in decoder_read()Max Kellermann1-0/+3
When the caller passes length==0, decoder_read() entered an endless loop. Check that condition before entering the "while" loop.
2008-11-13decoder: additional dc.command checks in decoder_data()Max Kellermann1-0/+3
When a command is sent while the decoder waits for a free chunk in the music pipe, it was not returned by decoder_data().
2008-11-13decoder: wait for the player only if the music pipe is fullMax Kellermann1-4/+5
Prevent superfluous wakeups and a deadlock condition.
2008-11-13decoder: check dc.command at the beginning of decoder_data()Max Kellermann1-0/+4
Seeking was somewhat broken in some decoder plugins because they sent empty chunks, and never got a command. Check the decoder command before doing anything else in decoder_data().
2008-11-13decoder: ignore SEEK commands during initializationMax Kellermann1-1/+4
When the decoder receives a SEEK during initialization, it should ignore that for now. The old code made most decoders abort.
2008-11-11replay_gain: no CamelCaseMax Kellermann1-3/+3
Renamed functions and variables.
2008-11-11decoder: fixed assertion failure for decoder==NULL in decoder_read()Max Kellermann1-1/+2
The assertion on dc.state in decoder_read() was too strict: when a decoder tried to call decoder_read() from tag_dup(), the decoder state was NONE. Allow this special case.
2008-11-10decoder: added more assertionsMax Kellermann1-0/+10
Added a lot of assertions checking the state of the decoder plugin.
2008-11-03decoder: no CamelCaseMax Kellermann1-4/+4
Renamed variables and functions.
2008-11-03decoder_api: send song tag in decoder_data()Max Kellermann1-8/+26
Before passing the first chunk to the audio output device, send the current song's tag.
2008-11-03decoder_api: automatically send stream tagMax Kellermann1-0/+51
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.
2008-11-03decoder_api: no CamelCaseMax Kellermann1-34/+32
Renamed variables.
2008-11-02decoder_api: added decoder_tag()Max Kellermann1-0/+13
Provide an API for submitting additional tags from the stream.
2008-11-02decoder_api: pass "seekable" flag to decoder_initialized()Max Kellermann1-16/+8
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.
2008-11-02decoder: replaced music_pipe.audioFormat with dc.out_audio_formatMax Kellermann1-10/+13
.. and rename dc.audioFormat to dc.in_audio_format. The music pipe does not need to know the audio format, and its former "audioFormat" property indicated the format of the most recently added chunk, which might be confusing when you are reading the oldest chunks.
2008-11-02music_pipe: renamed ob_* functions to music_pipe_*Max Kellermann1-2/+2
Rename all functions to the new prefix.
2008-11-02renamed outputBuffer.[ch] to pipe.[ch]Max Kellermann1-1/+1
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.
2008-11-01decoder: manage decoder list in a static arrayMax Kellermann1-11/+0
Currently, there is no way to dynamically load decoder plugins, thus we don't need a dynamic list to manage them.
2008-10-30decoder: use bool for return values and flagsMax Kellermann1-2/+2
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
2008-10-29decoder: automatically flush the output buffer after decoder exitsMax Kellermann1-5/+0
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().
2008-10-29decoder_api: make the audio_format parameter mandatoryMax Kellermann1-5/+3
There are no callers which pass audio_format==NULL, and it shouldn't be allowed.
2008-10-29decoder_api: removed decoder_clear()Max Kellermann1-5/+4
Call ob_clear() in decoder_command_finished() instead of implementing that call in every decoder plugin.
2008-10-29decoder_api: don't cast need_chunks() to intMax Kellermann1-4/+4
need_chunks() returns a decoder_command enum. Store its return value as this type.
2008-10-26input_stream: no CamelCaseMax Kellermann1-3/+3
Renamed all functions and variables.
2008-10-21pcm_utils: added pcm_convert_init()Max Kellermann1-1/+1
Instead of manually calling memset(0) on the pcm_convert_state struct, client code should use a library function from pcm_utils.c. This way, we can change the semantics of the struct easily.
2008-10-21pcm_utils: no CamelCaseMax Kellermann1-5/+5
Renamed all functions which were still in CamelCase.
2008-10-17input_stream: removed nmemb argumentMax Kellermann1-1/+1
The nmemb argument isn't actually useful, and one of nmemb and size was always passed as 1. Remove it.
2008-10-17input: declare struct input_streamMax Kellermann1-3/+5
Provide a struct type which can be forward-declared. The typedef InputStream is deprecated now.
2008-10-08song: removed CamelCaseMax Kellermann1-1/+1
CamelCase is ugly... rename all functions.
2008-10-08use the "bool" data type instead of "int"Max Kellermann1-1/+1
"bool" should be used in C99 programs for boolean values.
2008-10-08don't include os_compat.hMax Kellermann1-0/+2
When there are standardized headers, use these instead of the bloated os_compat.h.
2008-10-08song: converted typedef Song to struct songMax Kellermann1-0/+1
Again, a data type which can be forward-declared.
2008-09-29switch to C99 types, part IIMax Kellermann1-1/+1
Do full C99 integer type conversion in all modules which were not touched by Eric's merged patch.
2008-09-09audio: moved cmpAudioFormat() to audio_format.hMax Kellermann1-1/+1
Rename it to audio_format_equals() and return "true" if they are equal.
2008-09-07audio_format: converted typedef AudioFormat to struct audio_formatMax Kellermann1-1/+1
Get rid of CamelCase, and don't use a typedef, so we can forward-declare it, and unclutter the include dependencies.
2008-08-26renamed player.c to player_control.cMax Kellermann1-1/+1
Give player.c a better name, meaning that the code is used to control the player thread.
2008-08-26renamed decode.h to decoder_control.hMax Kellermann1-1/+1
2008-08-26moved global variable "pc" to player.hMax Kellermann1-1/+1
This is the last of the three variables. Now we don't need playerData.h anymore in most sources.