aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/flac_plugin.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* decoder/flac: check "seekable" in libFLAC callbacksMax Kellermann2009-11-111-0/+6
| | | | | Return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED if this input stream does not support seeking.
* decoder/flac: moved code to flac_data_get_audio_format()Max Kellermann2009-11-111-12/+4
| | | | | | Remove the audio_format attribute, add "frame_size" instead. The audio_format initialization and check is moved both to flac_data_get_audio_format().
* decoder/flac: use stream_info instead of audio_formatMax Kellermann2009-11-111-2/+2
| | | | | Use the sample rate stored in the stream_info struct instead of the audio_format struct.
* decoder/flac: calculate time stamp from current frameMax Kellermann2009-11-111-7/+2
| | | | | | | | | Don't update a float timestamp, this will make imprecisions add up after a while. We already have the number of the current frame, let's just calculate the float timestamp from that for every decoder_data() command. For this, we need to add the attribute "first_frame", for CUE sheet songs.
* decoder/flac: calculate bit rate in flac_common_write()Max Kellermann2009-11-111-11/+12
| | | | | | Removed the "bit_rate" attribute from the flac_data struct. Pass the number of bytes since the last call to flac_common_write(), and let it calculate the bit rate.
* decoder/flac: store the whole stream info object, not durationMax Kellermann2009-11-111-4/+10
| | | | | | | We don't want to work with floating point values if possible. Get the integer number of frames from the FLAC__StreamMetadata_StreamInfo object, and convert it into a float duration on demand. This patch adds a check if the STREAMINFO packet has been received yet.
* decoder/flac: merge code into flac_decoder_initialize()Max Kellermann2009-11-111-50/+39
| | | | | Wrapper for FLAC__stream_decoder_process_until_end_of_metadata(), decoder_initialized().
* decoder/flac: merged code into flac_decoder_new()Max Kellermann2009-11-111-28/+27
| | | | | Convenience wrapper for FLAC__stream_decoder_new() and FLAC__stream_decoder_set_metadata_respond().
* decoder/flac: free the "pathname" variable earlierMax Kellermann2009-11-111-31/+15
| | | | | Free the pointer right after its last use, i.e. after the FLAC__stream_decoder_init_file() call.
* decoder/flac: emulate FLAC__stream_decoder_init_stream()Max Kellermann2009-11-111-30/+12
| | | | Remove the wrapper flac_init().
* decoder/flac: use the new API functionsMax Kellermann2009-11-111-45/+52
| | | | | Use the type and function names of the libFLAC 1.1.3 API. Map the new API to the old one with macros.
* decoder/flac: removed the fake flac_ogg_init() fallbackMax Kellermann2009-11-111-0/+4
| | | | Don't even try to call it with an old libFLAC API.
* decoder/flac: moved code to flac_compat.hMax Kellermann2009-11-111-0/+5
|
* decoder/{flac,vorbis}: include config.h for LFSMax Kellermann2009-11-111-0/+1
| | | | Allow those plugins to open large files on 32 bit platforms.
* decoder/flac: merged code into flac_decoder_loop()Max Kellermann2009-11-111-101/+55
| | | | | | | The decoder loop of flac_decode_internal(), flac_container_decode() and flac_filedecode_internal() is merged into this one function. This unifies the code, and uses the frame number to identify the end of a CUE sub song.
* decoder/flac: keep track of current frame numberMax Kellermann2009-11-111-0/+3
| | | | We need this for more exact end-of-subsong detection for CUE files.
* Merge remote branch 'origin/v0.15.x'Max Kellermann2009-11-111-14/+8
|\
| * decoder/flac: fixed CUE seeking range checkMax Kellermann2009-11-111-14/+8
| | | | | | | | | | | | If flac_container_decode() gets a seek destination which is out of range, it ignores the SEEK command (never finishes it). This leads to MPD lockup, because the player thread waits for completion.
* | decoder/flac: removed redundant NULL checksMax Kellermann2009-11-111-9/+3
| | | | | | | | After the decoder loop, "flac_dec" is always set.
* | decoder/flac: moved code to flac_metadata.cMax Kellermann2009-11-111-0/+1
| |
* | decoder/flac: merged some code into flac_tag_apply_metadata()Max Kellermann2009-11-111-12/+4
| |
* | decoder/flac: don't use float to calculate song durationMax Kellermann2009-11-101-5/+2
| | | | | | | | | | Simple (up-rounding) integer division is good enough. We're casting the result back to an integer anyway.
* | decoder/flac: pass VorbisComment to comments_to_tag()Max Kellermann2009-11-101-2/+4
| |
* | decoder/flac: added function flac_data_deinit()Max Kellermann2009-11-101-8/+3
| | | | | | | | Clean up tag and replay_gain_info there.
* | Merged release 0.15.5 from branch 'v0.15.x'Max Kellermann2009-10-181-2/+3
|\| | | | | | | | | | | | | | | Conflicts: NEWS configure.ac src/decoder/flac_plugin.c src/update.c
| * decoder/flac: fixed two memory leaks in the CUE tag loaderMax Kellermann2009-10-161-2/+3
| | | | | | | | | | | | Don't initialize "vc" and "cs" with FLAC__metadata_object_new(); that value is overwritten by FLAC__metadata_get_tags() and FLAC__metadata_get_cuesheet().
* | tag: removed the "_ITEM_" suffix from the enum namesMax Kellermann2009-10-131-5/+2
| |
* | Merged release 0.15.1 from branch 'v0.15.x'Max Kellermann2009-07-161-2/+1
|\|
| * decoder/flac: fix assertion failure in tag_free() callMax Kellermann2009-07-061-2/+1
| | | | | | | | | | | | Initialize flac_data.tag right after flac_data_init(). This way, the "goto fail" won't jump to the point where tag_free(NULL) can be called.
* | flac: load external cue sheet when no internal oneSerge Ziryukin2009-07-091-0/+14
|/ | | | External cue sheet file for "file.flac" should be named as "file.flac.cue".
* flac: fixed "unused variable" warning without libcueMax Kellermann2009-04-011-2/+2
| | | | Move the declaration of "i" into the "for" loop.
* Tag subtracks according to "cuesheet" vorbis comment valueJochen Keil2009-03-311-4/+32
| | | | | | | Cuesheets are often saved as vorbis comment flac files (CUESHEET=.. case doesn't matter). We can parse this now and use the information to tag the subtracks (from the embedded cuesheets).
* track length is computed correctly nowJochen Keil2009-03-311-2/+1
|
* free previously allocated flac metadata objectJochen Keil2009-03-311-0/+1
|
* remove old commented codeJochen Keil2009-03-311-8/+0
|
* Bugfix for time/offset in flac pluginJochen Keil2009-03-281-3/+3
| | | | | | Previous cast to float didn't have any effect because one value is uint and the other is a floating type but the number itself is even.. This caused some tracks to end before they were really at an end.
* flac: get CUE track titles from additional FLAC commentsMario Lenz2009-03-161-6/+6
| | | | | | | | The cue sheet embedded in a flac file doen't contain any information about track titles and similar. There are three possibilities: Use an external cue sheet that includes these information, use a tag CUESHEET with a cue sheet including these information or use tags. I think the latter is the best option and is already used by other projects.
* all: Update copyright header.Avuton Olrich2009-03-131-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.
* Initial support for embedded cue sheets found in flac filesJochen Keil2009-03-091-3/+401
| | | | | | | | | So far only seekpoints are supported, so no proper tagging yet except for track number and track length. Tagging should be done by parsing the cue sheet which is often embedded as vorbis comment in flac files. Furthermore the pathname should be configurable like "%A - %t - %T", where %A means Artist, %t track number and %T Title or so.
* flac: explicitly check for STOP commandMax Kellermann2009-03-051-1/+2
| | | | | | After the decoder command was obtained, don't wait until libflac detects EOF (as a side effect), quit the decoder immediately. This check was missing completely.
* flac: check command after flac_process_single() failureMax Kellermann2009-03-051-3/+6
| | | | | | When the MPD core sends the decoder a command while flac_process_single() is executed, this function fails. Abort the decoder only if not seeking. This fixes a seeking bug.
* flac: parse stream tagsMax Kellermann2009-03-011-2/+15
| | | | | Parse the vorbis comments in libflac's metadata_callback and pass them as tag struct to the decoder API.
* decoder_plugin: pass struct config_param to init() methodMax Kellermann2009-02-151-1/+1
| | | | Preparing for per-plugin configuration sections in mpd.conf.
* moved fallback APE/ID3 tag loader to song.cMax Kellermann2009-01-171-17/+1
| | | | | | 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().
* flac: always allocate tag objectMax Kellermann2009-01-151-11/+21
| | | | | Free the tag object when it turns out to be empty. This simplifies several functions and APIs.
* flac: use bool instead of intMax Kellermann2009-01-151-27/+22
|
* flac: removed "vorbis_comment_found" flagMax Kellermann2009-01-151-10/+4
| | | | Use tag_is_empty() instead.
* flac: no CamelCaseMax Kellermann2009-01-151-82/+91
| | | | Renamed types, functions, variables.
* decoder plugins: don't include gcc.hMax Kellermann2009-01-011-7/+9
| | | | Use GLib's G_GNUC_UNUSED instead of gcc.h's mpd_unused.
* flac, mpc, ogg, wavpack: include unistd.h for SEEK_SETMax Kellermann2008-11-241-0/+1
| | | | SEEK_SET is defined by unistd.h. Explicitly include it.