aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-13 19:15:18 +0100
committerMax Kellermann <max@duempel.org>2012-02-13 19:15:18 +0100
commitc616165f81a07feb42b96b6078885b2a10c8908f (patch)
treed21c8c77c007e6de0bf50c6daf8f5998d8d978fd /src
parentedac498d03b9de59d4e55081c92604ff2447a298 (diff)
parent103832742d4ef2b6bb86d287b8557ab3e64dba21 (diff)
downloadmpd-c616165f81a07feb42b96b6078885b2a10c8908f.tar.gz
mpd-c616165f81a07feb42b96b6078885b2a10c8908f.tar.xz
mpd-c616165f81a07feb42b96b6078885b2a10c8908f.zip
Merge branch 'v0.16.x'
Conflicts: NEWS configure.ac src/decoder/ffmpeg_decoder_plugin.c test/read_tags.c
Diffstat (limited to 'src')
-rw-r--r--src/decoder/ffmpeg_metadata.c2
-rw-r--r--src/decoder_api.c6
-rw-r--r--src/output/winmm_output_plugin.c6
-rw-r--r--src/pcm_buffer.c5
-rw-r--r--src/pcm_buffer.h4
5 files changed, 17 insertions, 6 deletions
diff --git a/src/decoder/ffmpeg_metadata.c b/src/decoder/ffmpeg_metadata.c
index df700fc01..3d59ec1a9 100644
--- a/src/decoder/ffmpeg_metadata.c
+++ b/src/decoder/ffmpeg_metadata.c
@@ -28,8 +28,8 @@
static const struct tag_table ffmpeg_tags[] = {
#if LIBAVFORMAT_VERSION_INT < ((52<<16)+(50<<8))
{ "author", TAG_ARTIST },
- { "year", TAG_DATE },
#endif
+ { "year", TAG_DATE },
{ "author-sort", TAG_ARTIST_SORT },
{ "album_artist", TAG_ALBUM_ARTIST },
{ "album_artist-sort", TAG_ALBUM_ARTIST_SORT },
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 3d7f20c50..8f12d017a 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -90,6 +90,12 @@ decoder_prepare_initial_seek(struct decoder *decoder)
const struct decoder_control *dc = decoder->dc;
assert(dc->pipe != NULL);
+ if (dc->state != DECODE_STATE_DECODE)
+ /* wait until the decoder has finished initialisation
+ (reading file headers etc.) before emitting the
+ virtual "SEEK" command */
+ return false;
+
if (decoder->initial_seek_running)
/* initial seek has already begun - override any other
command */
diff --git a/src/output/winmm_output_plugin.c b/src/output/winmm_output_plugin.c
index 47d98498f..ed0f7f2d4 100644
--- a/src/output/winmm_output_plugin.c
+++ b/src/output/winmm_output_plugin.c
@@ -224,11 +224,7 @@ winmm_set_buffer(struct winmm_output *wo, struct winmm_buffer *buffer,
GError **error_r)
{
void *dest = pcm_buffer_get(&buffer->buffer, size);
- if (dest == NULL) {
- g_set_error(error_r, winmm_output_quark(), 0,
- "Out of memory");
- return false;
- }
+ assert(dest != NULL);
memcpy(dest, data, size);
diff --git a/src/pcm_buffer.c b/src/pcm_buffer.c
index c22157352..4b1eb875a 100644
--- a/src/pcm_buffer.c
+++ b/src/pcm_buffer.c
@@ -36,6 +36,11 @@ pcm_buffer_get(struct pcm_buffer *buffer, size_t size)
{
assert(buffer != NULL);
+ if (size == 0)
+ /* never return NULL, because NULL would be assumed to
+ be an error condition */
+ size = 1;
+
if (buffer->size < size) {
/* free the old buffer */
g_free(buffer->buffer);
diff --git a/src/pcm_buffer.h b/src/pcm_buffer.h
index 8c695c932..4502976f6 100644
--- a/src/pcm_buffer.h
+++ b/src/pcm_buffer.h
@@ -65,6 +65,10 @@ pcm_buffer_deinit(struct pcm_buffer *buffer)
/**
* Get the buffer, and guarantee a minimum size. This buffer becomes
* invalid with the next pcm_buffer_get() call.
+ *
+ * This function will never return NULL, even if size is zero, because
+ * the PCM library uses the NULL return value to signal "error". An
+ * empty destination buffer is not always an error.
*/
G_GNUC_MALLOC
void *