Commit Graph

22 Commits

Author SHA1 Message Date
Max Kellermann
17bdcc8bae decoder plugins: don't include gcc.h
Use GLib's G_GNUC_UNUSED instead of gcc.h's mpd_unused.
2009-01-01 18:09:24 +01:00
Max Kellermann
14e121af90 flac, mpc, ogg, wavpack: include unistd.h for SEEK_SET
SEEK_SET is defined by unistd.h.  Explicitly include it.
2008-11-24 10:33:08 +01:00
Max Kellermann
976d5045c6 decoder: check audio_format_valid() in all decoders
Refuse to play audio formats which are not supported by MPD.
2008-11-21 20:27:30 +01:00
Max Kellermann
63c3ebee46 flac, oggflac: use GLib instead of utils.h/log.h 2008-11-21 20:15:50 +01:00
Max Kellermann
7591403566 input_stream: size==-1 means unknown size
Define the special value "-1" as "unknown size".  Previously, there
was no indicator for streams with unknown size, which might confuse
some decoders.
2008-11-16 20:42:08 +01:00
Max Kellermann
9eed41911f decoder: return void from decode() methods
The stream_decode() and file_decode() methods returned a boolean,
indicating whether they were able to decode the song.  This is
redundant, since we already know that: if decoder_initialized() has
been called (and dc.state==DECODE), the plugin succeeded.  Change both
methods to return void.
2008-11-11 17:13:44 +01:00
Max Kellermann
114b3c1e78 replay_gain: no CamelCase
Renamed functions and variables.
2008-11-11 15:55:34 +01:00
Max Kellermann
ff1acefb21 decoder: removed plugin method try_decode()
Instead of having a seprate try_decode() method, let the
stream_decode() and file_decode() methods decide whether they are able
to decode the song.
2008-11-10 15:07:01 +01:00
Max Kellermann
23a4ce4444 flac: call flac_process_metadata() for ogg files
The flac plugin wasn't initialized properly when an OGG file was being
decoded.  For some reason, flac_process_metadata() was explicitly not
called for OGG files.  Since that seems to fix the issue, make it
always call flac_process_metadata().
2008-11-10 14:49:34 +01:00
Max Kellermann
0e87f85598 flac: enable the oggflac plugin with older libflac versions
Since decoder_list.c does not include the libflac headers, it cannot
know whether to add the oggflac plugin to the decoder list.  Solve
this by always enabling the oggflac sub-plugin, even with older
libflac versions.  When the libflac API cannot support oggflac,
disable the plugin at runtime by returning "false" from its init()
method.
2008-11-10 14:39:42 +01:00
Max Kellermann
b054ad0ea6 flac: make the init() method check for oggflac support
Disable flac's "oggflac" sub-plugin when libflac does not support
ogg-flac files.
2008-11-09 22:01:47 +01:00
Max Kellermann
85a7d1a148 decoder: removed stream_types
Instead of checking the stream_types bit set, we can simply check
whether the methods stream_decode() and file_decode() are implemented.
2008-11-04 17:10:19 +01:00
Max Kellermann
c9e15bc418 decoder_api: pass "seekable" flag to decoder_initialized()
Don't pass the "seekable" flag with every decoder_data() invocation.
Since that flag won't change within the file, it is enough to pass it
to decoder_initialized() once per file.
2008-11-02 17:01:51 +01:00
Max Kellermann
4c1b96c307 decoder: make the suffixes and mime_types arrays really const
The strings were constant, but the pointers weren't.  C syntax is
somewhat tricky..
2008-11-01 14:55:23 +01:00
Max Kellermann
0b614fbaae decoder: make all decoder_plugin structs const
All decoder_plugin structs are initialized at compile time, and must
never change.
2008-11-01 14:54:09 +01:00
Max Kellermann
78448fe1a5 decoder_api: pass constant path pointers 2008-10-31 15:56:43 +01:00
Max Kellermann
62d4fa9306 decoder: use bool for return values and flags
Don't return 0/-1 on success/error, but true/false.  Instead of int,
use bool for storing flags.
2008-10-30 08:38:54 +01:00
Max Kellermann
be90199c5a decoder_api: removed decoder_clear()
Call ob_clear() in decoder_command_finished() instead of implementing
that call in every decoder plugin.
2008-10-29 17:28:47 +01:00
Max Kellermann
5c19776f2f input_stream: use "bool" instead of "int"
For boolean values and success flags, use bool instead of integer (1/0
for true/false, 0/-1 for success/failure).
2008-10-26 20:56:46 +01:00
Max Kellermann
dbc7e9ba2f input_stream: no CamelCase
Renamed all functions and variables.
2008-10-26 20:34:47 +01:00
Max Kellermann
21b8590b53 input_stream: removed the InputStream typedef
Everybody should use struct input_stream.
2008-10-26 19:54:57 +01:00
Max Kellermann
e11355f47d renamed src/inputPlugins/ to src/decoder/
These plugins are not input plugins, they are decoder plugins.  No
CamelCase in the directory name.
2008-10-26 11:29:25 +01:00