Commit Graph

1673 Commits

Author SHA1 Message Date
Max Kellermann ba6ba7d4be DecoderControl: use std::chrono::duration for Seek() 2014-08-27 18:48:43 +02:00
Max Kellermann 0c2d767f6f DecoderAPI: use std::chrono::duration for decoder_seek*()
For type safety and code readability.
2014-08-26 22:27:04 +02:00
Max Kellermann 02e697032f decoder/pcm: use integer seek times 2014-08-26 22:05:02 +02:00
Max Kellermann 07dc262690 decoder/dsf: use integer seek times 2014-08-26 22:00:16 +02:00
Max Kellermann 6bf8d5b936 decoder/dsdiff: use integer seek times 2014-08-26 21:53:50 +02:00
Max Kellermann 93858bf262 decoder/wildmidi: use integer seek times 2014-08-26 11:41:48 +02:00
Max Kellermann f64da46a98 decoder/wavpack: use integer seek times 2014-08-26 11:39:58 +02:00
Max Kellermann 2052a029ee decoder/vorbis: use integer seek times 2014-08-26 11:38:39 +02:00
Max Kellermann c6aafff701 decoder/sndfile: use integer seek times 2014-08-26 11:36:20 +02:00
Max Kellermann 26f0f92210 decoder/opus: use integer seek times 2014-08-26 11:34:56 +02:00
Max Kellermann bdc4ae2b86 decoder/opus: remove redundant decoder_timestamp() call
After seeking, the MPD core automatically refreshes the timestamp, and
thus discards the value from decoder_timestamp().
2014-08-26 11:34:24 +02:00
Max Kellermann 9ca9341384 decoder/mpg123: use integer seek times 2014-08-26 11:31:57 +02:00
Max Kellermann 7f4f8b7c7d decoder/mpcdec: use integer seek times 2014-08-26 11:31:49 +02:00
Max Kellermann 8870526457 decoder/flac: use integer seek times 2014-08-26 11:30:21 +02:00
Max Kellermann f057e1e17a decoder/audiofile: use integer seek times 2014-08-26 11:29:22 +02:00
Max Kellermann 8561c9c5a6 DecoderAPI: add decoder_seek_where_frame() 2014-08-26 11:27:41 +02:00
Max Kellermann 23199719d9 decoder/mp4v2: use integer seek times 2014-08-26 11:20:15 +02:00
Max Kellermann a606ef0700 decoder/ffmpeg: use integer seek times 2014-08-26 11:15:53 +02:00
Max Kellermann a234de1ee3 decoder/gme: use integer seek times 2014-08-26 11:15:40 +02:00
Max Kellermann d266898617 decoder/modplug: use integer seek times 2014-08-26 11:11:36 +02:00
Max Kellermann 69b5929c5a decoder/mad: use integer seek times
Avoid roundtrips to floating point.
2014-08-26 11:07:47 +02:00
Max Kellermann 316c72a4ae DecoderAPI: add decoder_seek_where_ms()
Move to fixed-point integers instead of floating point.
2014-08-26 11:02:02 +02:00
Max Kellermann 9da88eec3e decoder/mad: move duplicate code to RecoverFrameError() 2014-08-26 10:52:17 +02:00
Max Kellermann f10d9996d2 decoder/mad: simplify if/else chain 2014-08-26 10:52:17 +02:00
Max Kellermann 58ec9d3a73 decoder/mad: make variables more local 2014-08-26 10:34:04 +02:00
Max Kellermann 4a503ba1ad decoder/mad: simplify "return", eliminate check
This check was redundant, because we could only exit the loop when
ret==DECODE_OK.
2014-08-26 10:30:22 +02:00
Max Kellermann da6dd2dc92 decoder/mad: don't reset the xing struct
Not necessary.
2014-08-25 10:32:40 +02:00
Max Kellermann 40b9de66c7 decoder/mad: remove unused flag "found_xing" 2014-08-25 10:31:55 +02:00
Max Kellermann aac985951a decoder/mad: convert enums/macros to constexpr 2014-08-24 21:06:50 +02:00
Max Kellermann 662cc5fe20 decoder/mad: make variables more local 2014-08-24 20:57:47 +02:00
Max Kellermann 8808aad529 decoder/dsdiff: implement seeking 2014-08-23 15:27:21 +02:00
Max Kellermann 6d7eaba845 decoder/dsdiff: refactor the main decoder loop
Check for STOP before decoding the first chunk.  This reduces the
command latency.
2014-08-23 15:25:40 +02:00
Max Kellermann 4259b17b91 decoder/dsdiff: add local variable "remaining_bytes"
Remember the chunk's total size.
2014-08-23 15:21:08 +02:00
Max Kellermann 828ea700e8 decoder/dsdiff: don't skip remaining bytes
Nobody cares.
2014-08-23 15:19:34 +02:00
Max Kellermann 7f22685fa3 decoder/dsdiff: eliminate local variable "buffer_samples" 2014-08-23 15:17:31 +02:00
Max Kellermann 40db9dff3b decoder/dsdiff: support only one "DSD" chunk
Eliminate the loop from dsdiff_stream_decode().  It makes the code
complex, real-world files with multiple DSD chunks are outside of the
specification, and the "chunk_size" variable would be bogus anyway.
2014-08-23 15:14:16 +02:00
Max Kellermann 67cc09416f decoder/dsf: implement seeking 2014-08-23 14:00:38 +02:00
Max Kellermann f2a75fbfc7 decoder/dsf: refactor the main decoder loop
Check for STOP before decoding the first chunk.  This reduces the
command latency.
2014-08-23 13:57:57 +02:00
Max Kellermann b1fb09e183 decoder/dsf: make the buffer more local
This allows the compiler to discard buffer contents between two
iterations.
2014-08-23 13:55:52 +02:00
Max Kellermann cd0082c630 decoder/dsf: eliminate pointless return statement 2014-08-23 13:54:07 +02:00
Max Kellermann f78527d1e3 decoder/dsf: use the block count internally 2014-08-23 13:51:08 +02:00
Max Kellermann 1f642238a7 decoder/dsf: don't skip remaining bytes
Nobody cares.
2014-08-23 13:50:36 +02:00
Max Kellermann 6fe06cad98 decoder/dsf: count the blocks, not the remaining bytes
Prepare refactoring the whole plugin to use blocks instead of bytes.
A block is the smallest addressable unit, and it will simplify the
seeking code.
2014-08-23 13:44:53 +02:00
Max Kellermann 2335fdbb5a decoder/dsf: allow channel setups other than stereo
This finishes the multi-channel support.  Development of the feature
was started with commit 02cc77cd8
2014-08-23 13:40:21 +02:00
Max Kellermann 1b6f7c3eb7 decoder/dsf: eliminate another hard-coded stereo mode assumption
When calculating the upper bound using the "sample count" format
header, don't assume it's stereo.
2014-08-23 13:39:00 +02:00
Max Kellermann 67f0d26d17 decoder/dsf: fix big-endian bugs 2014-08-23 13:35:29 +02:00
Max Kellermann 8574bcd494 decoder/dsf: compare with InputStream::GetRest() instead of ..GetSize() 2014-08-23 13:26:17 +02:00
Max Kellermann 02cc77cd82 decoder/dsf: fix multi-channel files
The plugin was horribly bugged for files that were not stereo.
2014-08-22 07:30:32 +02:00
Max Kellermann d8782ce5fd decoder/dsf: simplify dsf_to_pcm_order()
Don't pass the buffer size to the function, as it's known at compile
time.  Use "restrict" on the pointer arguments, and merge the two
loops, which allows the compiler to optimize this loop with a few SSE2
instructions.
2014-08-22 06:58:08 +02:00
Max Kellermann dedc2986c6 decoder/dsf: fix noise at end of malformed file
Read one block at a time.  This discards the last partial block, which
cannot be interleaved anyway.  Previously, uninitialised memory was
used to interleave the last block, which generated some noise.
2014-08-21 17:46:25 +02:00