Max Kellermann 
							
						 
					 
					
						
						
							
						
						d29bad4410 
					 
					
						
						
							
							mp3: make mp3_read() return bool  
						
						... 
						
						
						
						Its only caller in mp3_decode() just compared its value with
DECODE_BREAK.  Convert that to bool, and return false if the loop
should be ended.  Also eliminate some superfluous command checking
code, which was already done in the preceding while loop. 
						
						
					 
					
						2008-10-30 06:09:28 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						f8722913cf 
					 
					
						
						
							
							output: removed audio_output.result  
						
						... 
						
						
						
						Since open() and play() close the device on error, we can simply check
audio_output.open instead of audio_output.result after a call. 
						
						
					 
					
						2008-10-29 22:34:37 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						7da0e005f3 
					 
					
						
						
							
							output: delay reopen after device failure  
						
						... 
						
						
						
						When one of several output devices failed, MPD tried to reopen it
quite often, wasting a lot of resources.  This patch adds a delay:
wait 10 seconds before retrying.  This might be changed to exponential
delays later, but for now, it makes the problem go away. 
						
						
					 
					
						2008-10-29 22:32:50 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						0eae1c55ad 
					 
					
						
						
							
							output: moved code to audio_output_update()  
						
						... 
						
						
						
						Moved code from syncAudioDeviceStates() to audio_output_update(). 
						
						
					 
					
						2008-10-29 22:17:44 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						678314534a 
					 
					
						
						
							
							output: always call cancel() before stop()  
						
						... 
						
						
						
						Stopping an audio output device without cancelling its buffer doesn't
make sense.  Combine the two operations, which saves several cancel
calls. 
						
						
					 
					
						2008-10-29 22:17:42 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						07bb46de88 
					 
					
						
						
							
							input_file: refuse to open non-regular files  
						
						... 
						
						
						
						Don't allow users to open a file which is non-regular (e.g. pipes,
devices). 
						
						
					 
					
						2008-10-29 21:11:28 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						84f7d9c6b3 
					 
					
						
						
							
							input_file: check fstat() failure  
						
						
						
						
					 
					
						2008-10-29 21:11:20 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						fb08213659 
					 
					
						
						
							
							input_file: use GLib for logging  
						
						
						
						
					 
					
						2008-10-29 21:11:04 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						8f3d962219 
					 
					
						
						
							
							log: don't use utils.h  
						
						... 
						
						
						
						Prefer GLib over utils.h. 
						
						
					 
					
						2008-10-29 21:02:22 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						cf376b4bc8 
					 
					
						
						
							
							output: moved audioDeviceStates to audio_output.enabled  
						
						
						
						
					 
					
						2008-10-29 20:49:51 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						2f76db4c78 
					 
					
						
						
							
							output: close device on play error  
						
						... 
						
						
						
						When an output plugin fails to play a chunk, close it.  This replaces
various manual close() calls in nearly all plugins. 
						
						
					 
					
						2008-10-29 20:40:33 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						58c5bee9f0 
					 
					
						
						
							
							output: use bool for return values and flags  
						
						... 
						
						
						
						Don't return 0/-1 on success/error, but true/false.  Instead of int,
use bool for storing flags. 
						
						
					 
					
						2008-10-29 20:40:27 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						03390d8be1 
					 
					
						
						
							
							audio: call closeAudioDevice() on error  
						
						... 
						
						
						
						Instead of implementing another loop which calls audio_output_close()
on all configured devices, simply call closeAudioDevice(). 
						
						
					 
					
						2008-10-29 20:39:56 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						030238bb10 
					 
					
						
						
							
							audio: removed variable "audioOpened"  
						
						... 
						
						
						
						This variable is never read, and can be removed. 
						
						
					 
					
						2008-10-29 20:39:48 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						b967702059 
					 
					
						
						
							
							pulse: clear pa_simple pointer in pulse_close()  
						
						... 
						
						
						
						The pointer becomes invalid due to pa_simple_free(), which may lead to
segmentation faults when the output is reopened later. 
						
						
					 
					
						2008-10-29 20:38:20 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						d692e925a4 
					 
					
						
						
							
							pulse: use GLib instead of util.h/log.h  
						
						... 
						
						
						
						Use GLib allocation and logging functions. 
						
						
					 
					
						2008-10-29 20:37:36 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						38df17546a 
					 
					
						
						
							
							pulse: no CamelCase  
						
						
						
						
					 
					
						2008-10-29 20:37:15 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						2867c8e9b1 
					 
					
						
						
							
							player: handle songs shorter than the initial buffer  
						
						... 
						
						
						
						When the decoder exited before the buffer has grown big enough
("buffer_before_play"), the player thread waited forever.  Add an
additional check which disables buffering as soon as the decoder
exits. 
						
						
					 
					
						2008-10-29 18:35:10 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						5c4dc8d03c 
					 
					
						
						
							
							oss: check and override audio_format properly  
						
						... 
						
						
						
						Don't accept 24 bit audio.  Force MPD to use 16 bit if anything other
than 8 or 16 bit is selected. 
						
						
					 
					
						2008-10-29 18:35:03 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						c6714f1755 
					 
					
						
						
							
							player: added variable "play_audio_format"  
						
						... 
						
						
						
						The local variable "play_audio_format" is updated every time the
player starts playing a new song.  This way, we always know exactly
which audio format is current.  The old code broke when a new song had
a different format: ob.audio_format is the format of the next song,
not of the current one - using this caused breakage for the software
volume control. 
						
						
					 
					
						2008-10-29 17:29:30 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						528b7c3f5e 
					 
					
						
						
							
							decoder: automatically flush the output buffer after decoder exits  
						
						... 
						
						
						
						A decoder_flush() invocation was missing in the FLAC plugin, resulting
in casual assertion failures due to a wrong assumption about the last
chunk's audio format.  It's much easier to remove that decoder_flush()
function and make the decoder thread call ob_flush(). 
						
						
					 
					
						2008-10-29 17:29:06 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						74c85811af 
					 
					
						
						
							
							decoder_api: make the audio_format parameter mandatory  
						
						... 
						
						
						
						There are no callers which pass audio_format==NULL, and it shouldn't
be allowed. 
						
						
					 
					
						2008-10-29 17:29:03 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						c042faab42 
					 
					
						
						
							
							player: request new song only if there is no pending command  
						
						... 
						
						
						
						Request the next song from the playlist (by clearing pc.next_song)
only if the player command is empty.  If it is not, the player may be
clearing the song that has already been queued, leading to an
assertion failure. 
						
						
					 
					
						2008-10-29 17:28:49 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						be90199c5a 
					 
					
						
						
							
							decoder_api: removed decoder_clear()  
						
						... 
						
						
						
						Call ob_clear() in decoder_command_finished() instead of implementing
that call in every decoder plugin. 
						
						
					 
					
						2008-10-29 17:28:47 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						d6c4441c78 
					 
					
						
						
							
							mp3: seek in background  
						
						... 
						
						
						
						Remember the seek_where argument and call decoder_command_finished()
immediately.  This way, the player thread can continue working, and we
can receive more commands.
This also fixes several issues which resulted in broken frames,
leading to erroneos "elapsed" values: frames weren't parsed properly,
since the code was checking for command!=NONE. 
						
						
					 
					
						2008-10-29 17:22:56 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						de588448df 
					 
					
						
						
							
							mp3: return from mp3_synth_and_send() on any command  
						
						... 
						
						
						
						Previously, the function would only return when a STOP was issued.  It
makes more sense to consider all possible commands. 
						
						
					 
					
						2008-10-29 16:17:21 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						6158858f82 
					 
					
						
						
							
							mp3: moved code to mp3_synth_and_send()  
						
						... 
						
						
						
						Break the large function mp3_read() into smaller pieces. 
						
						
					 
					
						2008-10-29 16:14:08 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						e0532ae0a8 
					 
					
						
						
							
							mp3: moved code to mp3_send_pcm()  
						
						... 
						
						
						
						Break the large function mp3_read() into smaller pieces. 
						
						
					 
					
						2008-10-29 16:14:02 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						a6ad0e4047 
					 
					
						
						
							
							mp3: moved code to mp3_update_timer_next_frame()  
						
						... 
						
						
						
						Break the large function mp3_read() into smaller pieces. 
						
						
					 
					
						2008-10-29 16:13:51 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						0d079ee515 
					 
					
						
						
							
							mp3: moved code to mp3_this_frame_offset()  
						
						... 
						
						
						
						Break the large function mp3_read() into smaller pieces. 
						
						
					 
					
						2008-10-29 16:13:01 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						a6f8776c94 
					 
					
						
						
							
							mp3: moved code to mp3_time_to_frame()  
						
						... 
						
						
						
						Break the large function mp3_read() into smaller pieces. 
						
						
					 
					
						2008-10-29 16:12:26 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						ec3083948f 
					 
					
						
						
							
							mp3: assert that the stream is seekable  
						
						... 
						
						
						
						dc_seek() won't send a SEEK command to the decoder thread unless the
stream is seekable.  No need to do another check; convert that to an
assertion. 
						
						
					 
					
						2008-10-29 16:11:16 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						78b08f03f2 
					 
					
						
						
							
							decoder_api: don't cast need_chunks() to int  
						
						... 
						
						
						
						need_chunks() returns a decoder_command enum.  Store its return value
as this type. 
						
						
					 
					
						2008-10-29 16:11:15 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						a0b57f3782 
					 
					
						
						
							
							mp3: moved code to mp3_filesize_to_song_length()  
						
						... 
						
						
						
						The function mp3_decode_first_frame() is too large.  Move some code to
separate smaller functions. 
						
						
					 
					
						2008-10-28 20:44:08 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						898978a67d 
					 
					
						
						
							
							mp3: no "goto"  
						
						... 
						
						
						
						http://xkcd.com/292/  
					
						2008-10-28 20:43:17 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						28b47725ff 
					 
					
						
						
							
							mp3: use GLib allocation functions  
						
						... 
						
						
						
						This removes the need for util.h. 
						
						
					 
					
						2008-10-28 20:43:15 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						56ebdf1cd1 
					 
					
						
						
							
							mp3: use bool  
						
						... 
						
						
						
						Use the C99 bool data type for boolean values. 
						
						
					 
					
						2008-10-28 20:42:33 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						e4bbc120ac 
					 
					
						
						
							
							mp3: no CamelCase  
						
						... 
						
						
						
						Renamed all functions and variables.  Also removed the mp3DecodeData
typedef. 
						
						
					 
					
						2008-10-28 20:42:01 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						1f7c53e619 
					 
					
						
						
							
							mp3: remove obsolete comments  
						
						
						
						
					 
					
						2008-10-28 20:41:25 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						25f98a41c4 
					 
					
						
						
							
							input_file: don't use buffered I/O  
						
						... 
						
						
						
						Yet another superfluous buffering layer.  input_file was using FILE*,
but we're better off with unbuffered I/O using open(), read(), ... 
						
						
					 
					
						2008-10-28 20:41:24 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						0a61877702 
					 
					
						
						
							
							input_stream: convert offset and size to the off_t data type  
						
						... 
						
						
						
						size_t and long aren't 64 bit safe (i.e. files larger than 2 GB on a
32 bit OS).  Use off_t instead, which is a 64 bit integer if compiled
with large file support. 
						
						
					 
					
						2008-10-28 20:39:09 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						016d996131 
					 
					
						
						
							
							utils: use g_str_has_prefix() instead of prefixcmp()  
						
						... 
						
						
						
						Remove duplicated code from MPD. 
						
						
					 
					
						2008-10-28 20:33:56 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						4a71f66256 
					 
					
						
						
							
							player: reset pc.command when decoder startup fails  
						
						... 
						
						
						
						When the decoder failed to start, the function do_play() returned,
still having pc.command==PLAY.  This is because pc.command was reset
only when the decoder started up successfully.  Add another
player_command_finished() call in the error handler. 
						
						
					 
					
						2008-10-27 10:10:40 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						0d30d51f07 
					 
					
						
						
							
							input_file, input_curl: check URL type before attempting to open  
						
						... 
						
						
						
						Don't attempt to open a HTTP URL as a local file, and don't send a
local path to libcurl. 
						
						
					 
					
						2008-10-27 10:10:24 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						0800c6f4ca 
					 
					
						
						
							
							output: don't compile plugins which are disabled  
						
						... 
						
						
						
						Don't compile the sources of disabled output plugins at all. 
						
						
					 
					
						2008-10-26 21:58:37 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						3dac99034a 
					 
					
						
						
							
							dirvec: fixed GCC shadow warning  
						
						... 
						
						
						
						On some systems, string.h declares basename().  This emits a shadow
warning.  Change the variable name. 
						
						
					 
					
						2008-10-26 21:28:16 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						5f2384001e 
					 
					
						
						
							
							curl: read stream name from HTTP response headers  
						
						... 
						
						
						
						If the server sends the headers "icy-name", "ice-name",
"x-audiocast-name", set the stream title. 
						
						
					 
					
						2008-10-26 21:20:02 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						5d9ef0cd83 
					 
					
						
						
							
							input_curl: set input_stream.mime from Content-Type response header  
						
						
						
						
					 
					
						2008-10-26 21:19:32 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						1437a56a11 
					 
					
						
						
							
							input_curl: added local variable "value"  
						
						... 
						
						
						
						Replaced the local variable "colon" (which had only temporary meaning)
with the variable "value".  It is a pointer to the first byte of the
header value. 
						
						
					 
					
						2008-10-26 21:12:56 +01:00 
						 
				 
			
				
					
						
							
							
								Max Kellermann 
							
						 
					 
					
						
						
							
						
						d401589edf 
					 
					
						
						
							
							input_stream: use g_free() in input_stream_close()  
						
						... 
						
						
						
						g_free() allows passing the NULL pointer. 
						
						
					 
					
						2008-10-26 21:02:49 +01:00