Max Kellermann
0c5329aedc
decoder/mikmod: merged open()/close() into decode()
...
These functions are trivial, we don't need them separate.
2009-11-14 02:07:41 +01:00
Max Kellermann
2d236e281f
decoder/mikmod: static mod_Data object
...
Don't allocate this object, put it on the stack.
2009-11-14 02:07:41 +01:00
Max Kellermann
a6fd5819f9
doc: added decoder plugin reference
2009-11-14 02:06:23 +01:00
Max Kellermann
cef5dcc0a1
audio_format: added function audio_format_to_string()
...
Unified function for converting an audio_format object to a string,
for log messages and for the "status" command.
2009-11-14 01:15:26 +01:00
Max Kellermann
e5b119a324
autogen.sh: allow two minor digits in automake version
2009-11-14 01:15:26 +01:00
Max Kellermann
719990b1c5
decoder: use audio_format_init_checked()
...
Let the audio_check library verify the audio format in all (relevant,
i.e. non-hardcoded) plugins.
2009-11-14 00:47:22 +01:00
Max Kellermann
f47bb8c1db
audio_check: checker functions for audio_format attributes
...
These functions are a wrapper for audio_valid_X(). On error, they
return a GError object.
2009-11-14 00:47:19 +01:00
Max Kellermann
873025a495
decoder/sidplay: correctly calculate floating point time
...
Internally, use only the integer time. When needed, convert it to a
floating point seconds value.
2009-11-14 00:46:30 +01:00
Max Kellermann
409a3ed808
player_thread: corrected two assertions on "queued"
...
At this point, the function may be called from the SEEK handler.
2009-11-14 00:45:52 +01:00
Max Kellermann
76283c25a5
player_thread: initialize chunk->times in silence generator
...
When waiting for the decoder to provide more data, the player thread
generates silence chunks if needed. However, it forgot to initialize
the chunk.times attribute, which had now an undefined value. This
patch sets it to -1.0, meaning "value is undefined". Add a ">= 0.0"
check to audio_output_all_check(). This fixes spurious relative
seeking errors, because sometimes, the "elapsed" value falls back to
0.0.
2009-11-12 18:41:25 +01:00
Max Kellermann
b9866e43d3
player_control: hold lock while reading status
2009-11-12 18:40:36 +01:00
Max Kellermann
9947b82cad
added .#* to .gitignore
...
Temporary editor files.
2009-11-12 18:39:40 +01:00
Max Kellermann
5b82ffc291
include config.h in all sources
...
After we've been hit by Large File Support problems several times in
the past week (which only occur on 32 bit platforms, which I don't
have), this is yet another attempt to fix the issue.
2009-11-12 09:17:03 +01:00
Max Kellermann
8068fd5228
decoder/vorbis: fixed gcc "signed" warning
2009-11-12 09:16:34 +01:00
Max Kellermann
b9c610ac87
directory: include config.h
...
*sigh* another Large File breakage. ino_t/dev_t this time. We need
to include config.h in directory.h to get this straight.
2009-11-11 23:36:36 +01:00
Max Kellermann
59189160e3
decoder/wavpack: allow more than 2 channels
...
Remove the OPEN_2CH_MAX option. MPD's support for surround sound is
still clunky, but we're working on it.
2009-11-11 23:03:20 +01:00
Max Kellermann
ee5d3337a7
decoder/wavpack: activate 32 bit support
...
MPD has been supporting 32 bit samples since version 0.15. This patch
changes one check, and removes the 32->24 conversion code.
Note that WavPack floating point samples have 32 bits, and MPD doesn't
have a special check for floating point - therefore, this WavPack
plugin still returns 24 bit integer samples as before (until we have
float support in the MPD core).
2009-11-11 21:49:00 +01:00
Max Kellermann
4c6a8e3ca5
decoder/vorbis: initialize before entering the loop
...
Call decoder_initialize() before entering the loop. We don't need to
call ov_read() before ov_info(). When the stream number changes,
check if the audio format is still the same.
2009-11-11 21:34:55 +01:00
Max Kellermann
4f38cc9cae
decoder/vorbis: moved error strings to vorbis_strerror()
2009-11-11 21:12:10 +01:00
Max Kellermann
dfc09a37c9
decoder/vorbis: removed the OggCallbackData typedef
...
Use the struct name instead.
2009-11-11 21:09:08 +01:00
Max Kellermann
8588c21689
decoder/vorbis: fix typo in comment
2009-11-11 21:09:08 +01:00
Max Kellermann
2decc65b45
decoder/vorbis: removed redundant "bits" initialization
...
This is done by audio_format_init().
2009-11-11 21:03:04 +01:00
Max Kellermann
0fb877740b
decoder/flac: check "seekable" in libFLAC callbacks
...
Return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED if this input
stream does not support seeking.
2009-11-11 21:02:52 +01:00
Max Kellermann
37181c9181
decoder/flac: moved code to flac_data_get_audio_format()
...
Remove the audio_format attribute, add "frame_size" instead. The
audio_format initialization and check is moved both to
flac_data_get_audio_format().
2009-11-11 20:44:21 +01:00
Max Kellermann
08b139f37c
decoder/flac: use stream_info instead of audio_format
...
Use the sample rate stored in the stream_info struct instead of the
audio_format struct.
2009-11-11 20:36:53 +01:00
Max Kellermann
3973aeecd2
decoder/flac: use frame header instead of audio_format
...
When calculating the properties of the frame, use sample_rate and
other information from the frame header instead of the stored
audio_format object.
2009-11-11 20:36:46 +01:00
Max Kellermann
5b2d32b499
decoder/oggflac: moved stream_info check to oggflac_decode()
2009-11-11 20:36:21 +01:00
Max Kellermann
e0d5ee0045
decoder/flac: calculate time stamp from current frame
...
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.
2009-11-11 20:18:39 +01:00
Max Kellermann
d35efddd65
decoder/flac: calculate bit rate in flac_common_write()
...
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.
2009-11-11 19:52:14 +01:00
Max Kellermann
7b13776f2d
decoder/flac: store the whole stream info object, not duration
...
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.
2009-11-11 19:25:15 +01:00
Max Kellermann
f937ec9a7c
decoder/flac: merge code into flac_decoder_initialize()
...
Wrapper for FLAC__stream_decoder_process_until_end_of_metadata(),
decoder_initialized().
2009-11-11 19:08:10 +01:00
Max Kellermann
a3f5284dc6
decoder/flac: merged code into flac_decoder_new()
...
Convenience wrapper for FLAC__stream_decoder_new() and
FLAC__stream_decoder_set_metadata_respond().
2009-11-11 19:07:30 +01:00
Max Kellermann
4a8cc87b4d
decoder/flac: free the "pathname" variable earlier
...
Free the pointer right after its last use, i.e. after the
FLAC__stream_decoder_init_file() call.
2009-11-11 19:05:24 +01:00
Max Kellermann
183725733a
decoder/flac: emulate FLAC__stream_decoder_init_stream()
...
Remove the wrapper flac_init().
2009-11-11 18:08:22 +01:00
Max Kellermann
3c1bacbdbc
decoder/flac: use the new API functions
...
Use the type and function names of the libFLAC 1.1.3 API. Map the new
API to the old one with macros.
2009-11-11 17:59:46 +01:00
Max Kellermann
d5ed23438a
decoder/flac: removed the fake flac_ogg_init() fallback
...
Don't even try to call it with an old libFLAC API.
2009-11-11 17:01:14 +01:00
Max Kellermann
5bbaf0c9f1
decoder/flac: moved code to flac_compat.h
2009-11-11 16:43:34 +01:00
Max Kellermann
f2f8290242
decoder/{flac,vorbis}: include config.h for LFS
...
Allow those plugins to open large files on 32 bit platforms.
2009-11-11 16:37:42 +01:00
Max Kellermann
c1186693b5
decoder/flac: merged code into flac_decoder_loop()
...
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.
2009-11-11 16:28:44 +01:00
Max Kellermann
80b220a3a6
decoder/flac: keep track of current frame number
...
We need this for more exact end-of-subsong detection for CUE files.
2009-11-11 15:31:17 +01:00
Max Kellermann
5cc3c4f503
Merge remote branch 'origin/v0.15.x'
2009-11-11 15:14:20 +01:00
Max Kellermann
96204ea3dc
fd_util: don't call fd_set_nonblock() if open() has failed
...
This fixes an assertion failure.
2009-11-11 14:30:38 +01:00
Max Kellermann
9d1a34e30b
added missing config.h includes for extended LFS support
...
All sources which might work with large files must include config.h,
to get Large File Support on 32 bit platforms.
2009-11-11 14:15:34 +01:00
Max Kellermann
69d9716f8b
update: added missing config.h includes
...
This broke sticker and archive support.
2009-11-11 14:13:24 +01:00
Max Kellermann
dca4d9cf83
decoder/flac: fixed CUE seeking range check
...
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.
2009-11-11 08:55:55 +01:00
Max Kellermann
707b9fea17
decoder/flac: removed redundant NULL checks
...
After the decoder loop, "flac_dec" is always set.
2009-11-11 08:37:21 +01:00
Max Kellermann
68f77e4163
oggflac: rewind stream after FLAC detection
...
The oggflac plugin has been completely broken for quite a while and
nobody has noticed - maybe we should remove it?
2009-11-11 08:14:37 +01:00
Max Kellermann
d605329f83
decoder/flac: moved code to flac_pcm.c
2009-11-11 07:59:22 +01:00
Max Kellermann
f6e7dffada
decoder/flac: moved code to flac_metadata.c
2009-11-11 07:50:40 +01:00
Max Kellermann
43549db718
decoder/flac: return replay_gain_info object from helper function
...
Make the function more generic by not passing "struct flac_data" to
it.
2009-11-11 07:35:16 +01:00