| Commit message (Collapse) | Author | Files | Lines |
|
Removed shout's encoder plugin API in favor of the new generic encoder
plugin API.
|
|
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.
|
|
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.
|
|
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.
|
|
"float (*lamebuf)[2] = g_malloc()" does NOT allocate two float*
buffers. The formula is even wrong: it should be applied to LAME's
output buffer, not its input buffer.
Converted "lamebuf" to the two variables "left" and "right", and
allocate them independently with the exact buffer size. Set
right=left if mono output is configured.
|
|
It's easier to work with an int16_t* pointer here.
|
|
|
|
Don't compile the sources of disabled output plugins at all.
|
|
Again, no CamelCase in the directory name.
|
|
The last bit of CamelCase in audio_format.h. Additionally, rename a
bunch of local variables.
|
|
Having an array with disabled entries sucks. Removed that
DISABLED_SHOUT_ENCODER_PLUGIN macro, and fill the plugin list only
with plugins which are actually enabled. This should be done for all
plugin types.
|
|
Do full C99 integer type conversion in all modules which were not
touched by Eric's merged patch.
|
|
The inline function audio_format_sample_size() calculates how many
bytes each sample consumes. This function already takes into account
that 24 bit samples are 4 bytes long, not 3.
|
|
Since the buffer size is known at compile time, we can save an
indirection by declaring it as a char array instead of a pointer.
That saves an extra allocation, and we can calculate with the
compile-time constant sizeof(data) instead of the attribute "max_len".
|
|
Declare both shout plugins "const", since they will never change, once
initialized at compile time.
|
|
Don't typedef the structs at all. It is easier to forward-declare
this way.
Don't typedef methods. They are used exactly once, a few lines below.
|
|
[mk: moved this patch after "Refactor and cleanup of shout Ogg and MP3
audio outputs". The original commit message follows, although it is
outdated:]
Creation of shout_mp3 audio output plugin. Basically I just copied the
existing shout plugin and replaced ogg with lame. Uses lame for mp3
encoding. Next step is to pull common functionality out of each shout
plugin and share it between them.
Configuration options for "shout_mp3" are the same as for "shout".
|