aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/mad_plugin.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2010-07-20tag_rva2: set "gain", not "peak"Max Kellermann1-2/+2
RVA2 tags only store the "gain" value, there is no "peak" attribute.
2010-07-20decoder/mad: parse_rva2() returns boolMax Kellermann1-9/+8
2010-05-30decoder/mad: fix buffer variable name on !HAVE_ID3TAGMax Kellermann1-3/+3
2010-04-13decoder/mad: properly calculate ID3 size without libid3tagMax Kellermann1-5/+25
Without libid3tag, we were trying to skip the ID3 frame (since 0.15.2). Its length however was not calculated at all, we were just dropping everything from the current input buffer. This lead to the first few seconds of the file being skipped. This patch attempts to calculate the ID3v2 frame size with the formula from: http://www.id3.org/id3v2.4.0-structure 3.1 and 6.2
2010-02-27decoder/mad: fix crash when seeking at end of songMax Kellermann1-4/+0
Removed the decoder_command_finished() call at the end of mp3_decode(). This is invalid, because decoder_command_finished() has already been called in mp3_read().
2009-07-22mad: skip ID3 frames when libid3tag is disabledMax Kellermann1-6/+28
When libid3tag is disabled, the libmad decoder plugin is unable to identify ID3 frames. If the file starts with an (unidentified) ID3 frame, it assumes that the file is not a valid MP3 song. This patch solves this by adding minimal stubs for the ID3 functions.
2009-04-28mad_decoder: use g_ascii_strcasecmp() instead of strcasecmp()Max Kellermann1-4/+4
strcasecmp() is locale dependent, making it a bad choice for internal string comparisons.
2009-03-13all: Update copyright header.Avuton Olrich1-6/+7
This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
2009-02-17decoders: added and fixed GLib log domainsMax Kellermann1-3/+5
Fixed the log domains of the renamed decoders. Added G_LOG_DOMAIN macros in decoders which don't have one already.
2009-02-16renamed decoder plugin "mp3" to "mad"Max Kellermann1-2/+2
A decoder plugin should be named after the library which is used.
2009-02-15decoder_plugin: pass struct config_param to init() methodMax Kellermann1-1/+2
Preparing for per-plugin configuration sections in mpd.conf.
2009-01-17conf: use config_get_bool() instead of getBoolConfigParam()Max Kellermann1-4/+2
2009-01-17moved fallback APE/ID3 tag loader to song.cMax Kellermann1-9/+7
Some plugins used the APE or ID3 tag loader as a fallback when their own methods of loading tags did not work. Move this code out of all decoder plugins, into song_file_update().
2009-01-08added missing explicit config.h includesMax Kellermann1-0/+1
2008-12-28Add RVA2 tag support to MPDPauli Virtanen1-0/+94
This patch adds RVA2 (relative volume adjustment) tag support to mpd, as a fallback if no replaygain tags are found. The code is almost directly from madplay (GPL). RVA2 tags are generated for example by the "normalize" utility. Updated by: Avuton Olrich <avuton@gmail.com>
2008-12-24mp3: "tag" argument is unused when libid3tag is disabledMax Kellermann1-2/+2
Add G_GNUC_UNUSED attributes.
2008-12-08mp3: declare variables as "enum mp3_action"Max Kellermann1-2/+2
Variables which hold one of the DECODE_* values should be declared as "enum mp3_action" instead of "int".
2008-11-27mp3: use GLib loggingMax Kellermann1-19/+18
Use GLib's g_warning(), ... instead of MPD's deprecated log.h.
2008-11-13mp3: fix SEEK command check after mp3_synth_and_send()Max Kellermann1-5/+3
mp3 seeking was broken, because the command==SEEK check was never reached. Swap the command check order (==SEEK before !=NONE) to fix that.
2008-11-11mp3: support stream tagsMax Kellermann1-1/+8
Parse ID3 tags, even when they are in the middle of the stream. Very few streams provide embedded ID3 tags. Most of them send only Shoutcast "icy" tags, which limits the practical usefulness of this patch.
2008-11-11mp3: eliminated duplicate command checkMax Kellermann1-18/+20
When a command is received, decode_next_frame_header() and decodeNextFrame() return DECODE_BREAK. This is already checked by both callers, which means that we can eliminate lots of decoder_get_command() checks.
2008-11-11decoder: return void from decode() methodsMax Kellermann1-6/+3
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.
2008-11-11replay_gain: converted struct replay_gain_info elements to an arrayMax Kellermann1-6/+6
Having an array instead of individual variables allows the use of the replay_gain_mode enum as an array index.
2008-11-11replay_gain: no CamelCaseMax Kellermann1-22/+25
Renamed functions and variables.
2008-11-04decoder: removed stream_typesMax Kellermann1-1/+0
Instead of checking the stream_types bit set, we can simply check whether the methods stream_decode() and file_decode() are implemented.
2008-11-03decoder_api: automatically send stream tagMax Kellermann1-41/+5
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-02decoder_api: pass "seekable" flag to decoder_initialized()Max Kellermann1-2/+2
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-01decoder: make the suffixes and mime_types arrays really constMax Kellermann1-2/+2
The strings were constant, but the pointers weren't. C syntax is somewhat tricky..
2008-11-01decoder: make all decoder_plugin structs constMax Kellermann1-1/+1
All decoder_plugin structs are initialized at compile time, and must never change.
2008-10-31decoder_api: pass constant path pointersMax Kellermann1-2/+2
2008-10-30decoder: use bool for return values and flagsMax Kellermann1-14/+14
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
2008-10-30mp3: make mp3_read() return boolMax Kellermann1-19/+7
Its only caller in mp3_decode() just compared its value with DECODE_BREAK. Convert that to bool, and return false if the loop should be ended. Also eliminate some superfluous command checking code, which was already done in the preceding while loop.
2008-10-29decoder: automatically flush the output buffer after decoder exitsMax Kellermann1-2/+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: removed decoder_clear()Max Kellermann1-5/+1
Call ob_clear() in decoder_command_finished() instead of implementing that call in every decoder plugin.
2008-10-29mp3: seek in backgroundMax Kellermann1-5/+7
Remember the seek_where argument and call decoder_command_finished() immediately. This way, the player thread can continue working, and we can receive more commands. This also fixes several issues which resulted in broken frames, leading to erroneos "elapsed" values: frames weren't parsed properly, since the code was checking for command!=NONE.
2008-10-29mp3: return from mp3_synth_and_send() on any commandMax Kellermann1-2/+2
Previously, the function would only return when a STOP was issued. It makes more sense to consider all possible commands.
2008-10-29mp3: moved code to mp3_synth_and_send()Max Kellermann1-60/+74
Break the large function mp3_read() into smaller pieces.
2008-10-29mp3: moved code to mp3_send_pcm()Max Kellermann1-29/+48
Break the large function mp3_read() into smaller pieces.
2008-10-29mp3: moved code to mp3_update_timer_next_frame()Max Kellermann1-16/+28
Break the large function mp3_read() into smaller pieces.
2008-10-29mp3: moved code to mp3_this_frame_offset()Max Kellermann1-10/+10
Break the large function mp3_read() into smaller pieces.
2008-10-29mp3: moved code to mp3_time_to_frame()Max Kellermann1-11/+21
Break the large function mp3_read() into smaller pieces.
2008-10-29mp3: assert that the stream is seekableMax Kellermann1-5/+5
dc_seek() won't send a SEEK command to the decoder thread unless the stream is seekable. No need to do another check; convert that to an assertion.
2008-10-28mp3: moved code to mp3_filesize_to_song_length()Max Kellermann1-23/+42
The function mp3_decode_first_frame() is too large. Move some code to separate smaller functions.
2008-10-28mp3: no "goto"Max Kellermann1-19/+36
http://xkcd.com/292/
2008-10-28mp3: use GLib allocation functionsMax Kellermann1-11/+9
This removes the need for util.h.
2008-10-28mp3: use boolMax Kellermann1-50/+51
Use the C99 bool data type for boolean values.
2008-10-28mp3: no CamelCaseMax Kellermann1-255/+254
Renamed all functions and variables. Also removed the mp3DecodeData typedef.
2008-10-28mp3: remove obsolete commentsMax Kellermann1-4/+0
2008-10-28input_stream: convert offset and size to the off_t data typeMax Kellermann1-1/+1
size_t and long aren't 64 bit safe (i.e. files larger than 2 GB on a 32 bit OS). Use off_t instead, which is a 64 bit integer if compiled with large file support.
2008-10-28utils: use g_str_has_prefix() instead of prefixcmp()Max Kellermann1-1/+2
Remove duplicated code from MPD.