Commit Graph

2766 Commits

Author SHA1 Message Date
Max Kellermann 06f9b6c379 main: don't close all file descriptors on startup
Removed closeAllFDs().  The caller is responsible for closing all file
handles.
2008-11-05 18:21:36 +01:00
Max Kellermann 5d6e96e986 pulse: removed reconnect interval
The output thread automatically waits some time before retrying to
open the device.  Don't duplicate this check in the pulse plugin.
2008-11-05 08:10:13 +01:00
Max Kellermann 3defcef5f3 pulse: check if connection is open in pulse_cancel()
The pulse plugin crashed with a segmentation fault when the pulse
server was killed.
2008-11-05 08:06:39 +01:00
Max Kellermann eedbd28ec9 wavpack: read_bytes() should not return after partial reads
libwavpack expects the read_bytes() stream method to fill the whole
buffer, and fails badly when we return a partial read (i.e. not enough
data available yet).  This caused wavpack streams to break.
Re-implement the buffer filling loop.
2008-11-05 07:24:57 +01:00
Max Kellermann 010a27cd95 wavpack: don't close the stream
The input_stream object is opened and closed by the caller.
2008-11-05 07:13:55 +01:00
Max Kellermann 104d5120c9 configure.ac: check for avcodec_decode_audio2()
Disable the ffmpeg decoder plugin if avcodec_decode_audio2() is not
available.
2008-11-04 17:42:37 +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 59c20e5afe wavpack: removed NULL element from tagtypes
The number of tag types is known at compile time.  Use the GLib macro
G_N_ELEMENTS instead of having a NULL element at the end.
2008-11-04 17:10:17 +01:00
Max Kellermann 66eb3e90c3 wavpack: use enum tag_type
Don't store tag type values in a plain integer, use the proper enum.
2008-11-04 17:10:13 +01:00
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