Commit Graph

2957 Commits

Author SHA1 Message Date
Max Kellermann 946e69b2f6 wavpack: use GLib instead of utils.h / log.h
Replace deprecated code with GLib.
2008-11-04 17:10:10 +01:00
Max Kellermann 097bccd4ae wavpack: read first byte from wvc stream
Instead of manually waiting for the input stream to become ready (to
catch server errors), just read the first byte.  Since the
wavpack_input has the capability to push back one byte, we can simply
re-feed it.  Advantage is: decoder_read() handles everything for us,
i.e. waiting for the stream, polling for decoder commands and error
handling.
2008-11-04 17:10:03 +01:00
Max Kellermann 3cf54591e9 wavpack: use the bool data type
Use boolean true/false instead of 1/0.
2008-11-04 17:10:01 +01:00
Max Kellermann b6ea410ca7 wavpack: no CamelCase
Renamed functions and variables.
2008-11-04 17:08:59 +01:00
Max Kellermann c1dfa52cbf wavpack: fix indent
Fixed the indent of the switch statement in format_samples_int().
2008-11-04 17:08:57 +01:00
Max Kellermann fef14683ae mp4: get decoder command from decoder_data()
Eliminate a superfluous decoder_get_command() call.  decoder_data()
already returns the command.
2008-11-04 17:05:08 +01:00
Max Kellermann 11404b5d10 mp4: initialize audio_format before decoder_initialized()
Removed the duplicate audio_format initialization.
2008-11-04 17:05:05 +01:00
Max Kellermann 290347c482 mp4: use decoder_read() instead of input_stream_read()
decoder_read() handles decoder commands, and should be used in decoder
plugins.
2008-11-04 17:05:02 +01:00
Max Kellermann 9ecfc57c3a mp4: pass struct mp4_context to the mp4ff_callback_t methods
We need the decoder object, so we have to begin passing a new struct
to these callbacks, instead of only the pointer to the input_stream
object.
2008-11-04 17:05:00 +01:00
Max Kellermann 632dc7c96b mp4: use GLib instead of utils.h / log.h
Replace deprecated code with GLib.
2008-11-04 17:04:57 +01:00
Max Kellermann 01706dd46c mp4: use tag_is_empty() instead of passing the tag_is_found flag
The API of mp4_load_tag() was strange: it always returned a tag
object, no matter if a tag was found in the file; the existence of a
tag was indicated with the tag_found integer reference.  This flag is
superfluous, since we can simply check whether the tag is empty or
not.
2008-11-04 17:04:54 +01:00
Max Kellermann 02a172f2c2 mp4: static mp4ff_callback_t variables
Allocate the mp4ff_callback_t object on the stack.  This is easier to
handle, since we don't have to free it.  Incidentally, this fixes a
memory leak in mp4_load_tag().
2008-11-04 16:55:12 +01:00
Max Kellermann 8712a1f7bf mp4: no CamelCasee
Renamed functions and variables.
2008-11-04 16:55:12 +01:00
Max Kellermann ab07cdd453 ffmpeg: removed loop from mpd_ffmpeg_read()
The function decoder_read() already cares about the decoder command,
and loops until data is available.  Reduced mpd_ffmpeg_read() to no
more than the decoder_read() call.
2008-11-04 16:55:12 +01:00
Max Kellermann 292334a27a ffmpeg: removed ffmpeg_context.codec
That variable is never used except during initialization in
ffmpeg_helper().
2008-11-04 16:55:12 +01:00
Max Kellermann 7e84c73b17 ffmpeg: moved code to ffmpeg_find_audio_stream() 2008-11-04 16:55:12 +01:00
Max Kellermann 5e486964e8 ffmpeg: no CamelCase
Renamed variables.
2008-11-04 16:55:11 +01:00
Max Kellermann e26bff9b92 tag: added tag_is_empty() 2008-11-04 16:55:11 +01:00
Max Kellermann d7b2d93ccc osx: fix gcc warnings
Fix prototypes and unused variables.
2008-11-04 11:26:04 +01:00
Max Kellermann 37696dcbbf osx: adapt to new output plugin API
The OS X output plugin wasn't adapted to the new output plugin yet,
because I had no Mac to test...
2008-11-04 11:19:37 +01:00
Max Kellermann 792711bddd configure.ac: unset MP4FF_LIBS when MP4 support is disabled
Although there is no AC_SUBST when $enable_mp4=no, autoconf
substitutes its value in Makefile.am.  Clear it in this case.
2008-11-04 07:46:47 +01:00
Max Kellermann 095a62a1d0 decoder: update dc.error after input stream failure
dc.error wasn't updated when the input stream failed to initialize.
2008-11-03 21:49:47 +01:00
Max Kellermann 75d2a39768 input_curl: use curl_multi_info_read()
The function curl_multi_info_read() provides access to errors from the
curl easy interface.
2008-11-03 21:49:43 +01:00
Max Kellermann fdf0d46e3d player: converted PLAYER_ERROR_* to enum 2008-11-03 21:49:40 +01:00
Max Kellermann eca0e6db3b player: removed "volatile" attributes
Removed the "volatile" attributes from several variables which are not
important for synchronization.
2008-11-03 21:49:36 +01:00
Max Kellermann 862bbc21a1 player: no CamelCase
Renamed variables and internal functions.  Most of the
player_control.h API remains in CamelCase for now.
2008-11-03 21:49:29 +01:00
Max Kellermann cfaf85e37d decoder: converted DECODE_ERROR_* to enum 2008-11-03 21:48:17 +01:00
Max Kellermann ec6d26788a decoder: removed "volatile" modifier
The variable "next_song" is already protected by a memory barrier.
"total_time" is not important for synchronization, and we don't need
"volatile" here.
2008-11-03 21:44:12 +01:00
Max Kellermann 863badd91e decoder: no CamelCase
Renamed variables and functions.
2008-11-03 21:43:02 +01:00
Max Kellermann b3dfcfef52 decoder_api: send song tag in decoder_data()
Before passing the first chunk to the audio output device, send the
current song's tag.
2008-11-03 20:20:09 +01:00
Max Kellermann ac96022c1d decoder_api: automatically send stream tag
If an input stream provides tags (e.g. from an icecast server), send
them in the decoder_data() and decoder_tag() methods.  Removed the
according code from the mp3 and oggvorbis plugins - decoders shouldn't
have to care about stream tags.

This patch also adds the missing decoder_tag() invocation to the mp3
plugin.
2008-11-03 18:24:01 +01:00
Max Kellermann 8bb2da063f tag: added function tag_has_type()
tag_has_type() checks whether the tag contains one or more items with
the specified type.
2008-11-03 18:24:00 +01:00
Max Kellermann b9d456a041 decoder_api: no CamelCase
Renamed variables.
2008-11-03 17:56:41 +01:00
Avuton Olrich b54348a1e5 configure.ac: disable libflac's oggflac support with --disable-oggflac
The configure flag "--disable-oggflac" disabled only liboggflac.
2008-11-03 17:35:16 +01:00
Max Kellermann dda8fc4f6b configure.ac: AC_SUBST(MP4FF_LIBS)
The AC_SUBST() call was missing in the previous patch.
2008-11-03 17:35:06 +01:00
Max Kellermann f70dccdce1 configure.ac: separate the "aac" and "mp4" decoder tests
MPD used to have a copy of the mp4ff library.  Since that has been
removed, AAC suport was disabled when there was no libmp4ff.  Separate
the libmp4ff test, and enable AAC support no matter if libmp4ff is
available.
2008-11-03 16:48:12 +01:00
Max Kellermann 9074f924e9 alsa: initialize "device" with NULL
When using autodetection, AlsaData.device wasn't properly initialized
with NULL.  This broke autodetection randomly.
2008-11-03 07:40:54 +01:00
Max Kellermann e6f334a088 mod: removed boolean globals for lazy init
The variables mod_mikModInitiated and mod_mikModInitError were used to
control lazy initialization, but they are superfluous now.
2008-11-03 07:32:02 +01:00
Max Kellermann bb15c3bd45 mod: always initialize libmikmod
The "mod" decoder plugin was being initialized lazily, but was
deinitialized unconditionally.  That led to segmentation faults.
Convert mod_initMikMod() to be the global module initialization
method.  The MPD core should care about lazy initialization.
2008-11-03 07:30:42 +01:00
Max Kellermann 79d70f124d output: don't allow length==0
Nobody should call playAudio() with an empty chunk.  Add some
assertions on that.
2008-11-02 20:16:56 +01:00
Max Kellermann cc164cc884 player: don't play empty chunks
An empty chunk may happen when it only contains a tag, but no PCM
data.  Don't call playAudio() then.
2008-11-02 20:14:55 +01:00
Max Kellermann e5137706d1 ffmpeg: fix boolean inversion in ffmpeg_tag()
ffmpeg_tag() deleted the tag when ffmpeg_helper() returned success.
The return value was interpreted incorrectly, it should return the tag
on success.
2008-11-02 17:32:40 +01:00
Max Kellermann 1e0acb2e1a removed unused sources
Cleaning up artifacts from a merge gone wrong.  Also remove the
ringbuf library, which is not being used.
2008-11-02 17:16:07 +01:00
Max Kellermann fb233df7a9 player: copy stream tag to the song struct
Non-local songs used to have no tags.  If the decoder sends us a tag,
we should incorporate it into the song struct.  This way, clients can
always show the correct song name (if provided by the server).
2008-11-02 17:13:26 +01:00
Max Kellermann 7e7704e42b player: added player.song
Always remember which song is currently being sent to the audio
device.
2008-11-02 17:10:26 +01:00
Max Kellermann accc82cd6c ffmpeg: don't rewind stream in url_close()
Rewinding the stream here is not useful, but may consume valuable
resources (and time).
2008-11-02 17:10:12 +01:00
Max Kellermann 2124df1390 decoder: rewind input stream after try_decode()
The try_decode() method may have read some data from the stream, which
is now lost.  To make this data available to other methods, get it
back by rewinding the input stream after each try_decode() invocation.

The ogg and wavpack plugins did this manually and inconsistently; this
code can now be removed.
2008-11-02 17:10:02 +01:00
Max Kellermann 395aa4e847 decoder: moved code to decoder_try_decode() 2008-11-02 17:07:39 +01:00
Max Kellermann 5183d85886 player: send chunk tag to audio device
If a chunk contains a tag, send it to the audio output device.  Few
output plugins support this, e.g. shout has support for sending tags.
2008-11-02 17:07:31 +01:00
Max Kellermann aa9b31f1cf crossfade: copy tag
If the source chunk has a tag, merge it into the destination chunk.
The source chunk gets deleted after that, and this is our last chance
to grab the tag.
2008-11-02 17:07:13 +01:00