aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/mp3_plugin.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fix -Wconst warningsMax Kellermann2008-02-051-2/+2
| | | | | | [ew: cleaned up the dirty union hack a bit] Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fixed "comparison between signed and unsigned"Max Kellermann2008-01-261-2/+2
| | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7146 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fixed -Wshadow warningsMax Kellermann2008-01-261-8/+8
| | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7143 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Cleanup #includes of standard system headers and put them in one placeEric Wong2008-01-031-7/+1
| | | | | | | | | | | | | This will make refactoring features easier, especially now that pthreads support and larger refactorings are on the horizon. Hopefully, this will make porting to other platforms (even non-UNIX-like ones for masochists) easier, too. os_compat.h will house all the #includes for system headers considered to be the "core" of MPD. Headers for optional features will be left to individual source files. git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Simplify decode cleanup logic a bitEric Wong2008-01-011-12/+0
| | | | | | | | | | | DECODE_STATE_STOP is always set as dc->state, and dc->stop is always cleared. So handle it in decodeStart once rather than doing it in every plugin. While we're at it, fix a long-standing (but difficult to trigger) bug in mpc_decode where we failed to return if mpc_decoder_initialize() fails. git-svn-id: https://svn.musicpd.org/mpd/trunk@7122 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* conf: improved boolean config parameter handling from -keEric Wong2007-09-051-4/+3
| | | | | | the force flag will issue FATAL() if an invalid value is specified git-svn-id: https://svn.musicpd.org/mpd/trunk@6857 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* inputPlugins/mp3_plugin: parse LAME tags for ReplayGain infoJ. Alexander Treuman2007-08-221-46/+104
| | | | | | | | | | | | Parse ReplayGain info in LAME tags and use it if no ID3v2 ReplayGain tags are found. This is currently a bit unsafe, as apparently some LAME tags have bogus ReplayGain values. But I'm finding a lot of MP3s with valid LAME tags that fail the LAME tag CRC check. So until I figure out why that's happening, it's an unreliable method for checking if the LAME tag is valid. A big thanks to tmz for writing the original patch. git-svn-id: https://svn.musicpd.org/mpd/trunk@6798 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Making some bool options more consistent.J. Alexander Treuman2007-06-031-5/+7
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6468 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Cleaning up some comments.J. Alexander Treuman2007-04-091-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5894 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* The massive copyright updateAvuton Olrich2007-04-051-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't initialize globals to zero (or NULL)Eric Wong2007-01-141-12/+1
| | | | | | | | Some compilers and linkers aren't smart enough to optimize this, as global variables are implictly initialized to zero. As a result, binaries are a bit smaller as more goes in the .bss and less in the text section. git-svn-id: https://svn.musicpd.org/mpd/trunk@5254 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* mp3: sparse: fix warnings reported with -WshadowEric Wong2007-01-141-8/+7
| | | | | | sendDataToOutputBuffer returns an int (and always has), and using the existing 'ret' is fine in mp3Read(). git-svn-id: https://svn.musicpd.org/mpd/trunk@5246 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Added gapless_mp3_playback option. Setting to "no" will disable gaplessJ. Alexander Treuman2006-12-231-2/+15
| | | | | | | MP3 playback, thus allowing songs that run longer than the Xing frame claims (f.e., an MP3 created by catting two MP3s together) to continue playing past the end. git-svn-id: https://svn.musicpd.org/mpd/trunk@5157 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Only parse gapless info if the input stream is seekable, under theJ. Alexander Treuman2006-12-231-1/+2
| | | | | | assumption that non-seekable streams are live and any gapless info is incorrect. git-svn-id: https://svn.musicpd.org/mpd/trunk@5150 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't stop decoding if we're at maxFrames just because there's a Xing tag.J. Alexander Treuman2006-12-231-4/+3
| | | | | | Instead, stop decoding as soon as we've found the frames/samples at the "end" that we want drop. git-svn-id: https://svn.musicpd.org/mpd/trunk@5149 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Cleaning up some damn near unreadable wrapping caused by indent.J. Alexander Treuman2006-12-231-25/+8
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5148 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Properly calculate the number of remaining samples in the MP3 frame, evenJ. Alexander Treuman2006-12-231-5/+7
| | | | | though in practice it should never matter. git-svn-id: https://svn.musicpd.org/mpd/trunk@5147 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* mp3_plugin.c: fix compilation with -pedantic and/or gcc 2.95Eric Wong2006-10-061-16/+20
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4876 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* handle invalid xing tags better.Warren Dukes2006-10-031-18/+26
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4866 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong2006-08-261-3/+3
| | | | | | | | | | | | | | | | | | | I'm checking for zero-size allocations and assert()-ing them, so we can more easily get backtraces and debug problems, but we'll also allow -DNDEBUG people to live on the edge if they wish. We do not rely on errno when checking for OOM errors because some implementations of malloc do not set it, and malloc is commonly overridden by userspace wrappers. I've spent some time looking through the source and didn't find any obvious places where we would explicitly allocate 0 bytes, so we shouldn't trip any of those assertions. We also avoid allocating zero bytes because C libraries don't handle this consistently (some return NULL, some not); and it's dangerous either way. git-svn-id: https://svn.musicpd.org/mpd/trunk@4690 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Use strcasecmp to check for replaygain id3v2 tags, since apparently some ↵J. Alexander Treuman2006-08-231-4/+4
| | | | | apps write them in all caps. git-svn-id: https://svn.musicpd.org/mpd/trunk@4672 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Instead of ignoring mp2/mp3 files that start with a layer 1 frame, just skip ↵J. Alexander Treuman2006-08-231-2/+1
| | | | | the layer 1 frames looking for a layer 2 or 3 frame. git-svn-id: https://svn.musicpd.org/mpd/trunk@4671 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* If a frame header decode loses sync, just try again instead of trying to ↵J. Alexander Treuman2006-08-231-7/+3
| | | | | decode a frame (which will automatically decode the next header without allowing us to do some checks on it). git-svn-id: https://svn.musicpd.org/mpd/trunk@4670 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Skip layer 2 frames in mp3s and vice versa. Also drop support for layer 1, ↵J. Alexander Treuman2006-08-231-3/+15
| | | | | since it hasn't been tested. git-svn-id: https://svn.musicpd.org/mpd/trunk@4669 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* trivial: labels should be on the left-most column, no tabbingEric Wong2006-08-201-2/+2
| | | | | | | | | | | | Unfortunately there doesn't seem to be an indent switch for this, but we have find + perl: find src -name '*.[ch]' | xargs perl -i -p -e \ 's/^\s+(\w+):/$1:/g unless /^\s+default:/' This is a followup to r4605, and there are no actual code changes in this. git-svn-id: https://svn.musicpd.org/mpd/trunk@4661 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Stop decoding once we've dropped samples at the end (it messes up the audio ↵J. Alexander Treuman2006-08-131-1/+3
| | | | | if there's more mp3 to decode) git-svn-id: https://svn.musicpd.org/mpd/trunk@4619 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Presume that the Xing frame count is accurate, and stop decoding when we hit ↵J. Alexander Treuman2006-08-131-2/+9
| | | | | the last frame git-svn-id: https://svn.musicpd.org/mpd/trunk@4618 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Several fixes uncovered with -pedanticEric Wong2006-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | playerData.c: proper error checking directory.c: properly check myFgets() for errors (it returns NULL on error) inputPlugins/mp3_plugin.c get rid of commas at the end of enums interface.c: we weren't using long long, so strtoll isn't needed get rid of void-pointer arithmetic sllist.c: get rid of void-pointer arithmetic compress.c: get rid of C++ comments, some compilers don't accept them Note that I personally like void pointer arithmetic, but some ancient compilers don't support them :( git-svn-id: https://svn.musicpd.org/mpd/trunk@4510 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Silence a gcc warning... Properly.J. Alexander Treuman2006-07-261-1/+3
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4469 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Silence a gcc warningJ. Alexander Treuman2006-07-261-0/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4468 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jat's second tip of the day: when you change a ternary operator to an if, ↵J. Alexander Treuman2006-07-261-1/+1
| | | | | don't forget to take out everything after the :. And don't forget my first tip either. git-svn-id: https://svn.musicpd.org/mpd/trunk@4467 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Screw this found_* stuff, just wrap parse_*() in an ifJ. Alexander Treuman2006-07-261-11/+6
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4465 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't decode the first frame if it has a xing tag, not only if it has a xing ↵J. Alexander Treuman2006-07-261-1/+2
| | | | | tag with a frame count git-svn-id: https://svn.musicpd.org/mpd/trunk@4464 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Use the lame tag's encoder delay/padding to implement gapless mp3 playbackJ. Alexander Treuman2006-07-261-0/+53
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4462 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Parse lame tag for encoder delay/padding so we can later implement gaplessJ. Alexander Treuman2006-07-251-0/+67
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4460 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jat's tip of the day: remember to remove your silly debug messages before ↵J. Alexander Treuman2006-07-251-1/+0
| | | | | committing git-svn-id: https://svn.musicpd.org/mpd/trunk@4459 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add support for mp1/2. Thanks to Stephan Beyer for the patch.J. Alexander Treuman2006-07-251-2/+5
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4458 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Removing my stupid debug messages for testing xingJ. Alexander Treuman2006-07-251-2/+0
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4457 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Reworking xing parsing so lame tags will fit in betterJ. Alexander Treuman2006-07-251-20/+19
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4456 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Thanks for making my code totally unreadable indent!J. Alexander Treuman2006-07-251-80/+54
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4455 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add mpd-indent.shAvuton Olrich2006-07-201-6/+4
| | | | | | Add a few new options for indent to try to make things a bit cleaner git-svn-id: https://svn.musicpd.org/mpd/trunk@4411 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add mpd-indent.shAvuton Olrich2006-07-201-357/+440
| | | | | | Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix VBR mp3 seek accuracy bugJ. Alexander Treuman2006-07-181-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4399 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Cleaned up parse_xing, added support for Info magic, and added a ↵J. Alexander Treuman2006-07-181-15/+54
| | | | | parse_extension_headers function for when LAME tag support is added git-svn-id: https://svn.musicpd.org/mpd/trunk@4398 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Reindenting parse_xing, since I need to work on it and it's a messJ. Alexander Treuman2006-07-181-42/+41
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4397 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* inputPlugins/*_plugin.c: static-ficationEric Wong2006-07-171-18/+18
| | | | | | Nothing here is ever exported for linkage besides the InputPlugin structure, so mark them static to save a few bytes. git-svn-id: https://svn.musicpd.org/mpd/trunk@4382 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Remove hosted libid3tag & libmadAvuton Olrich2006-07-161-8/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4369 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Change shank's email addressJ. Alexander Treuman2006-07-141-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Huge header update, update the copyright and addAvuton Olrich2006-07-131-1/+1
| | | | | the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Cleanup id3 ReplayGain parsing code.J. Alexander Treuman2006-06-211-13/+19
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4280 09075e82-0dd4-0310-85a5-a0d7c8717e4f