aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/mp3_plugin.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-01-26fixed "comparison between signed and unsigned"Max Kellermann1-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
2008-01-26fixed -Wshadow warningsMax Kellermann1-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
2008-01-03Cleanup #includes of standard system headers and put them in one placeEric Wong1-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
2008-01-01Simplify decode cleanup logic a bitEric Wong1-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
2007-09-05conf: improved boolean config parameter handling from -keEric Wong1-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
2007-08-22inputPlugins/mp3_plugin: parse LAME tags for ReplayGain infoJ. Alexander Treuman1-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
2007-06-03Making some bool options more consistent.J. Alexander Treuman1-5/+7
git-svn-id: https://svn.musicpd.org/mpd/trunk@6468 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-09Cleaning up some comments.J. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5894 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-05The massive copyright updateAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14Don't initialize globals to zero (or NULL)Eric Wong1-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
2007-01-14mp3: sparse: fix warnings reported with -WshadowEric Wong1-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
2006-12-23Added gapless_mp3_playback option. Setting to "no" will disable gaplessJ. Alexander Treuman1-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
2006-12-23Only parse gapless info if the input stream is seekable, under theJ. Alexander Treuman1-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
2006-12-23Don't stop decoding if we're at maxFrames just because there's a Xing tag.J. Alexander Treuman1-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
2006-12-23Cleaning up some damn near unreadable wrapping caused by indent.J. Alexander Treuman1-25/+8
git-svn-id: https://svn.musicpd.org/mpd/trunk@5148 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-12-23Properly calculate the number of remaining samples in the MP3 frame, evenJ. Alexander Treuman1-5/+7
though in practice it should never matter. git-svn-id: https://svn.musicpd.org/mpd/trunk@5147 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-10-06mp3_plugin.c: fix compilation with -pedantic and/or gcc 2.95Eric Wong1-16/+20
git-svn-id: https://svn.musicpd.org/mpd/trunk@4876 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-10-03handle invalid xing tags better.Warren Dukes1-18/+26
git-svn-id: https://svn.musicpd.org/mpd/trunk@4866 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-26Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong1-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
2006-08-23Use strcasecmp to check for replaygain id3v2 tags, since apparently some ↵J. Alexander Treuman1-4/+4
apps write them in all caps. git-svn-id: https://svn.musicpd.org/mpd/trunk@4672 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-23Instead of ignoring mp2/mp3 files that start with a layer 1 frame, just skip ↵J. Alexander Treuman1-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
2006-08-23If a frame header decode loses sync, just try again instead of trying to ↵J. Alexander Treuman1-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
2006-08-23Skip layer 2 frames in mp3s and vice versa. Also drop support for layer 1, ↵J. Alexander Treuman1-3/+15
since it hasn't been tested. git-svn-id: https://svn.musicpd.org/mpd/trunk@4669 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-20trivial: labels should be on the left-most column, no tabbingEric Wong1-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
2006-08-13Stop decoding once we've dropped samples at the end (it messes up the audio ↵J. Alexander Treuman1-1/+3
if there's more mp3 to decode) git-svn-id: https://svn.musicpd.org/mpd/trunk@4619 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-13Presume that the Xing frame count is accurate, and stop decoding when we hit ↵J. Alexander Treuman1-2/+9
the last frame git-svn-id: https://svn.musicpd.org/mpd/trunk@4618 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01Several fixes uncovered with -pedanticEric Wong1-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
2006-07-26Silence a gcc warning... Properly.J. Alexander Treuman1-1/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@4469 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Silence a gcc warningJ. Alexander Treuman1-0/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@4468 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26jat's second tip of the day: when you change a ternary operator to an if, ↵J. Alexander Treuman1-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
2006-07-26Screw this found_* stuff, just wrap parse_*() in an ifJ. Alexander Treuman1-11/+6
git-svn-id: https://svn.musicpd.org/mpd/trunk@4465 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Don't decode the first frame if it has a xing tag, not only if it has a xing ↵J. Alexander Treuman1-1/+2
tag with a frame count git-svn-id: https://svn.musicpd.org/mpd/trunk@4464 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Use the lame tag's encoder delay/padding to implement gapless mp3 playbackJ. Alexander Treuman1-0/+53
git-svn-id: https://svn.musicpd.org/mpd/trunk@4462 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25Parse lame tag for encoder delay/padding so we can later implement gaplessJ. Alexander Treuman1-0/+67
git-svn-id: https://svn.musicpd.org/mpd/trunk@4460 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25jat's tip of the day: remember to remove your silly debug messages before ↵J. Alexander Treuman1-1/+0
committing git-svn-id: https://svn.musicpd.org/mpd/trunk@4459 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25Add support for mp1/2. Thanks to Stephan Beyer for the patch.J. Alexander Treuman1-2/+5
git-svn-id: https://svn.musicpd.org/mpd/trunk@4458 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25Removing my stupid debug messages for testing xingJ. Alexander Treuman1-2/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@4457 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25Reworking xing parsing so lame tags will fit in betterJ. Alexander Treuman1-20/+19
git-svn-id: https://svn.musicpd.org/mpd/trunk@4456 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25Thanks for making my code totally unreadable indent!J. Alexander Treuman1-80/+54
git-svn-id: https://svn.musicpd.org/mpd/trunk@4455 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-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
2006-07-20Add mpd-indent.shAvuton Olrich1-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
2006-07-18Fix VBR mp3 seek accuracy bugJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4399 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-18Cleaned up parse_xing, added support for Info magic, and added a ↵J. Alexander Treuman1-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
2006-07-18Reindenting parse_xing, since I need to work on it and it's a messJ. Alexander Treuman1-42/+41
git-svn-id: https://svn.musicpd.org/mpd/trunk@4397 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-17inputPlugins/*_plugin.c: static-ficationEric Wong1-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
2006-07-16Remove hosted libid3tag & libmadAvuton Olrich1-8/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@4369 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-14Change shank's email addressJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-13Huge header update, update the copyright and addAvuton Olrich1-1/+1
the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-06-21Cleanup id3 ReplayGain parsing code.J. Alexander Treuman1-13/+19
git-svn-id: https://svn.musicpd.org/mpd/trunk@4280 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-06-21Silly jat, don't use newMpdTag as a variable name!J. Alexander Treuman1-4/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@4279 09075e82-0dd4-0310-85a5-a0d7c8717e4f