aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/shout_mp3.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-02-22shout: use the new encoder APIMax Kellermann1-193/+0
Removed shout's encoder plugin API in favor of the new generic encoder plugin API.
2009-02-10shout_mp3: use audio_format_frame_size()Max Kellermann1-2/+1
Use audio_format_frame_size() instead of channels*audio_format_sample_size().
2009-02-10shout: pass void pointer to the encoderMax Kellermann1-2/+2
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.
2009-02-09shout: clear buffer before calling the encoderMax Kellermann1-3/+3
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.
2009-02-09shout: don't postpone metadataMax Kellermann1-1/+1
Don't duplicate the tag received by the send_metadata() method - send it to the shout server directly.
2009-02-02shout_mp3: call lame_close() in clear_encoder() methodMax Kellermann1-2/+6
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.
2009-02-02shout_mp3: free the lame_data struct on exitMax Kellermann1-0/+2
Make valgrind a little bit happier: free the global lame_data struct in the finish() method.
2008-11-30shout: fixed the lame input buffer allocationMax Kellermann1-9/+15
"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.
2008-11-30shout_mp3: cast input buffer to int16_t*Max Kellermann1-2/+2
It's easier to work with an int16_t* pointer here.
2008-11-25shout: use GLib instead of utils.h/log.hMax Kellermann1-14/+12
2008-10-26output: don't compile plugins which are disabledMax Kellermann1-5/+1
Don't compile the sources of disabled output plugins at all.
2008-10-26renamed src/audioOutputs/ to src/output/Max Kellermann1-2/+1
Again, no CamelCase in the directory name.
2008-10-10audio_format: renamed sampleRate to sample_rateMax Kellermann1-1/+1
The last bit of CamelCase in audio_format.h. Additionally, rename a bunch of local variables.
2008-10-09shout: removed DISABLED_SHOUT_ENCODER_PLUGINMax Kellermann1-4/+0
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.
2008-09-29switch to C99 types, part IIMax Kellermann1-1/+1
Do full C99 integer type conversion in all modules which were not touched by Eric's merged patch.
2008-09-23audio_format: added audio_format_sample_size()Max Kellermann1-1/+1
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.
2008-09-12shout: make the shout_buffer staticMax Kellermann1-1/+1
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".
2008-09-12shout: constant plugin declarationsMax Kellermann1-1/+1
Declare both shout plugins "const", since they will never change, once initialized at compile time.
2008-09-12shout: removed typedefs on structs and plugin methodsMax Kellermann1-18/+17
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.
2008-09-12shout: added mp3 encoderEric Wollesen1-0/+194
[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".