| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Convert the num_supported and num_unsupported variables from signed to
unsigned.
|
|
|
|
| |
Renamed types, functions and variables.
|
|
|
|
| |
When the sample format is unknown, fall back to 16 bit samples.
|
|
|
|
|
|
| |
Simplify error handling a bit by moving some code into a separate
function. This eliminates a good bunch of gotos, but that's not
finished yet.
|
|
|
|
|
| |
When the MVP device has been closed in the cancel() method, and the
play() method attempts to reopen it, check for errors.
|
|
|
|
| |
Moved the table lookup code to a separate function.
|
|
|
|
| |
The array must never be modified, it's a constant lookup table.
|
|
|
|
|
|
| |
Looks like the MVP audio output only supports 16 and 24 bit audio
samples. If MPD generates any other sample formats, force it to use
16 bit.
|
|
|
|
| |
When the channel count is greater than 2, fall back to stereo sound.
|
|
|
|
|
| |
Return true/false instead of 0/-1. Also check its return value in
mvp_output_open().
|
|
|
|
|
| |
Pass a pointer to the audio_format struct instead of 3 separate
integers.
|
|
|
|
|
| |
Don't pass the big_endian flag to mvp_set_pcm_params(), do a simple
"G_BYTE_ORDER==G_LITTLE_ENDIAN" instead.
|
|
|
|
|
| |
Instead of manually calculating the number of elements in the
mvp_sample_rates array, use GLib's convenience macro G_N_ELEMENTS().
|
|
|
|
| |
Renamed types, functions and variables.
|
|
|
|
| |
Return true/false for success/failure instead of returning 0/-1.
|
|
|
|
| |
Renamed types, functions and variables.
|
|
|
|
|
| |
The MPD core guarantees that the audio_output object is always
consistent, and our timer!=NULL checks are superfluous.
|
|
|
|
| |
Renamed functions and variables.
|
|
|
|
|
|
|
| |
The MPD core guarantees that the audio_output object is always in a
consistent state: either open or closed. When open, it will not call
the open() method again, and when closed, it will not call play().
Removed several checks and the NULL initialization.
|
|
|
|
|
| |
The method is empty, and we can simply set the method pointer to NULL
instead.
|
|
|
|
|
|
| |
audio_output_get_name() has been removed, which was the only function
left in output_api.h. The output plugin doesn't need the audio_output
object at all, remove the parameter from the init() method.
|
|
|
|
| |
Use config_get_block_string("name") instead of audio_output_get_name().
|
|
|
|
|
| |
Fix a gcc warning, initialize the "space" variable at the beginning of
mpd_jack_play().
|
|
|
|
|
|
| |
The meaning of the chunk depends on the audio format; don't suggest a
specific format by declaring the pointer as "char*", pass "void*"
instead.
|
|
|
|
|
|
|
|
| |
The old API required an output plugin to not return until all data
passed to the play() method is consumed. Some output plugins have to
loop to fulfill that requirement, and may block during that. Simplify
these, by letting them consume only part of the buffer: make play()
return the length of the consumed data.
|
|
|
|
|
| |
There are no plugins left which require shout_plugin.h. Moved the
struct declaration to shout_plugin.c.
|
|
|
|
| |
This array is empty, and is not used anymore.
|
|
|
|
|
| |
Removed shout's encoder plugin API in favor of the new generic encoder
plugin API.
|
|
|
|
|
| |
The method implementation my_shout_open_device() consists of only one
line, the call to open_shout_conn(). Merge both functions into one.
|
|
|
|
| |
Return true/false instead of 0/-1.
|
|
|
|
|
|
|
| |
Now that I've found this nice function in the GLib docs, we can
finally remove our custom sleep function. Still all those callers of
g_usleep() have to be migrated one day to use events, instead of
regular polling.
|
|
|
|
| |
If an output plugin requires config.h, it should include it directly.
|
|
|
|
|
| |
The output plugin shouldn't know any specifics of the mixer API. Make
it return the mixer object, and let the caller deal with it.
|
|
|
|
|
| |
Use audio_format_frame_size() instead of
channels*audio_format_sample_size().
|
|
|
|
|
|
| |
Pass the music chunk as a "const void *" to the encoder, instead of a
"const char *". Actually, both encoders currently expect 16 bit
samples, passing a 8-bit character is rather pointless.
|
|
|
|
|
|
| |
For simplification, moved the PCM conversion code to
pcm16_to_ogg_buffer(). Work with a int16_t pointer instead of a char
pointer.
|
|
|
|
|
| |
writeSize is a memory size and its type should thus be size_t. This
allows us to remove two explicit casts.
|
|
|
|
| |
Nobody needs these debug messages anymore.
|
|
|
|
|
|
|
| |
Always assume the buffer is empty before calling the encoder. Always
flush the buffer immediately after there has been added something.
This reduces the risk of buffer overruns, because there will never be
a "rest" in the current buffer.
|
|
|
|
|
| |
Don't duplicate the tag received by the send_metadata() method - send
it to the shout server directly.
|
|
|
|
|
| |
Removed the manual timer synchronization from the shout plugin.
libshout's shout_sync() function does it for us.
|
|
|
|
|
|
| |
The non-blocking mode of libshout is sparsely documented, and MPD's
implementation had several bugs. Also removed connect throttling
code, that is done by the MPD core since 0.14.
|
|
|
|
|
| |
When shout_data.tag!=NULL, there is a "tag to send". The tag_to_send
flag is redundant.
|
|
|
|
| |
That variable is set in handle_shout_error(), but is never read.
|
|
|
|
|
|
|
|
|
|
| |
The shout_mp3 encoder had two bugs: when no song was ever played, MPD
segfaulted during cleanup. Second bug: memory leak, each time the
shout device was opened, lame_init() was called again, and
lame_close() is only called once during shutdown.
Fix this by shutting down LAME each time the clear_encoder() method is
called.
|
|
|
|
|
| |
Make valgrind a little bit happier: free the global lame_data struct
in the finish() method.
|
|
|
|
|
|
| |
Move the "while" loop which checks for commands to the caller
ao_pause(). This simplifies the pause() method, and lets us remove
audio_output_is_pending().
|
|
|
|
|
| |
The function is only used by the MVP output plugin, and this one call
is wrong.
|
|
|
|
|
|
| |
If no ports are configured, don't overwrite the (NULL) configuration
with the port names of the first JACK server. If the server changes
after a JACK reconnect, MPD won't attempt to auto-detect again.
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the JACK plugin manipulates the audio_format struct which
was passed to the open() method. This is very likely to break,
because the plugin must not permanently store this pointer. After
this patch, MPD ignores sample rate changes. It looks like other
software is doing the same, and I guess this is a non-issue.
This patch converts the audio_format pointer within jack_data into a
static audio_format struct.
|