Compare commits

...

16 Commits

Author SHA1 Message Date
Avuton Olrich
30847e6c77 mpd version 0.15.6 2009-11-18 18:49:25 -08:00
Max Kellermann
97f8e017c4 decoder/flac: fixed NULL pointer dereference in CUE code
The function flac_vtrack_tnum() was missing a strrchr()==NULL check.
2009-11-18 19:55:38 +01:00
Max Kellermann
f51ba6464a id3: allow 4 MB RIFF/AIFF tags
Allow RIFF/AIFF ID3 tags up to 4 MB (old limit was 256 kB).  This
might still be too small for some users, and when somebody complains,
we might do something more clever (like streaming the data into
libid3tag?).
2009-11-15 18:44:53 +01:00
Max Kellermann
77b95d08a5 decoder/ffmpeg: align the output buffer
On some platforms, libavcodec wants the output buffer aligned to 16
bytes (because it uses SSE/Altivec internally).  It will segfault when
you don't obey this rule.
2009-11-15 17:39:09 +01:00
Max Kellermann
dca4d9cf83 decoder/flac: fixed CUE seeking range check
If flac_container_decode() gets a seek destination which is out of
range, it ignores the SEEK command (never finishes it).  This leads to
MPD lockup, because the player thread waits for completion.
2009-11-11 08:55:55 +01:00
Max Kellermann
68f77e4163 oggflac: rewind stream after FLAC detection
The oggflac plugin has been completely broken for quite a while and
nobody has noticed - maybe we should remove it?
2009-11-11 08:14:37 +01:00
Max Kellermann
93a13b42dd zzip: require libzzip 0.13
We need the function zzip_file_stat().
2009-11-10 21:00:10 +01:00
Max Kellermann
96fcf5e1a5 input/mms: require libmms 0.4
We're using API functions which are not available in 0.3.
2009-11-10 20:57:10 +01:00
Max Kellermann
937b2b1744 sticker: added fallback for sqlite3_prepare_v2()
This function was not present in SQLite < 3.4.
2009-11-10 20:55:29 +01:00
Max Kellermann
8c0680f6b9 input/lastfm: fixed variable name in GLib<2.16 code path
Should be "lastfm_user", not "lastfm_username".
2009-11-10 20:54:17 +01:00
Max Kellermann
b242175e18 song_save: increased maximum line length to 32 kB
The line buffer had a fixed size of 5 kB, and was allocated on the
stack.  This was too small for some users.  As a hotfix, we're
increasing the buffer size to 32 kB now, allocated on the heap.  In
MPD 0.16, we'll switch to dynamic allocation.
2009-11-01 15:27:55 +01:00
Max Kellermann
3de912e2b9 decoder_control: removed unused DECODE_TYPE macros 2009-10-31 18:03:50 +01:00
Max Kellermann
04816a6369 decoder/ffmpeg: convert metadata
Convert the metadata with the libavformat function av_metadata_conv().
This ensures that canonical tag names are provided by libavformat, and
we can remove the "artist" vs "author" workaround.
2009-10-28 22:12:22 +01:00
Max Kellermann
d083032236 update: delete ignored symlinks from database
When you disable the "follow_outside_symlinks" or the
"follow_inside_symlinks" setting, the next update should remove the
now-ignored files from the database.
2009-10-27 22:06:28 +01:00
Max Kellermann
1a6ed81193 output_thread: check again if output is open on PAUSE
Basically the same as the 0.15.5 patch "check again if output is open
on CANCEL".  Same race condition, same fix.
2009-10-21 08:07:07 +02:00
Avuton Olrich
b2b300b635 Modify version string to post-release version 0.15.6~git 2009-10-18 09:50:17 -07:00
13 changed files with 96 additions and 35 deletions

20
NEWS

@@ -1,3 +1,23 @@
ver 0.15.6 (2009/11/18)
* input:
- lastfm: fixed variable name in GLib<2.16 code path
- input/mms: require libmms 0.4
* archive:
- zzip: require libzzip 0.13
* tags:
- id3: allow 4 MB RIFF/AIFF tags
* decoders:
- ffmpeg: convert metadata
- ffmpeg: align the output buffer
- oggflac: rewind stream after FLAC detection
- flac: fixed CUE seeking range check
- flac: fixed NULL pointer dereference in CUE code
* output_thread: check again if output is open on PAUSE
* update: delete ignored symlinks from database
* database: increased maximum line length to 32 kB
* sticker: added fallback for sqlite3_prepare_v2()
ver 0.15.5 (2009/10/18)
* input:
- curl: don't abort if a packet has only metadata

@@ -1,5 +1,5 @@
AC_PREREQ(2.60)
AC_INIT(mpd, 0.15.5, musicpd-dev-team@lists.sourceforge.net)
AC_INIT(mpd, 0.15.6, musicpd-dev-team@lists.sourceforge.net)
AC_CONFIG_SRCDIR([src/main.c])
AM_INIT_AUTOMAKE([foreign 1.9 dist-bzip2])
AM_CONFIG_HEADER(config.h)
@@ -303,7 +303,7 @@ AC_ARG_ENABLE(mms,
[enable the MMS protocol with libmms]),,
[enable_mms=auto])
MPD_AUTO_PKG(mms, MMS, [libmms],
MPD_AUTO_PKG(mms, MMS, [libmms >= 0.4],
[libmms mms:// protocol support], [libmms not found])
if test x$enable_mms = xyes; then
AC_DEFINE(ENABLE_MMS, 1,
@@ -339,7 +339,7 @@ AC_ARG_ENABLE(zip,
[enable zip archive support (default: disabled)]),,
enable_zip=no)
MPD_AUTO_PKG(zip, ZZIP, [zziplib],
MPD_AUTO_PKG(zip, ZZIP, [zziplib >= 0.13],
[libzzip archive library], [libzzip not found])
AM_CONDITIONAL(HAVE_ZIP, test x$enable_zip = xyes)

@@ -415,6 +415,8 @@ flac_vtrack_tnum(const char* fname)
* another/better way would be to use tag struct
*/
char* ptr = strrchr(fname, '_');
if (ptr == NULL)
return 0;
// copy ascii tracknumber to int
char vtrack[4];

@@ -209,6 +209,21 @@ ffmpeg_helper(struct input_stream *input,
return ret;
}
/**
* On some platforms, libavcodec wants the output buffer aligned to 16
* bytes (because it uses SSE/Altivec internally). This function
* returns the aligned version of the specified buffer, and corrects
* the buffer size.
*/
static void *
align16(void *p, size_t *length_p)
{
unsigned add = 16 - (size_t)p % 16;
*length_p -= add;
return (char *)p + add;
}
static enum decoder_command
ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
const AVPacket *packet,
@@ -217,7 +232,9 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
{
enum decoder_command cmd = DECODE_COMMAND_NONE;
int position;
uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16];
int16_t *aligned_buffer;
size_t buffer_size;
int len, audio_size;
uint8_t *packet_data;
int packet_size;
@@ -225,11 +242,13 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
packet_data = packet->data;
packet_size = packet->size;
buffer_size = sizeof(audio_buf);
aligned_buffer = align16(audio_buf, &buffer_size);
while ((packet_size > 0) && (cmd == DECODE_COMMAND_NONE)) {
audio_size = sizeof(audio_buf);
audio_size = buffer_size;
len = avcodec_decode_audio2(codec_context,
(int16_t *)audio_buf,
&audio_size,
aligned_buffer, &audio_size,
packet_data, packet_size);
if (len < 0) {
@@ -250,7 +269,7 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
: 0;
cmd = decoder_data(decoder, is,
audio_buf, audio_size,
aligned_buffer, audio_size,
position,
codec_context->bit_rate / 1000, NULL);
}
@@ -352,17 +371,17 @@ ffmpeg_copy_metadata(struct tag *tag, AVMetadata *m,
static bool ffmpeg_tag_internal(struct ffmpeg_context *ctx)
{
struct tag *tag = (struct tag *) ctx->tag;
const AVFormatContext *f = ctx->format_context;
AVFormatContext *f = ctx->format_context;
tag->time = 0;
if (f->duration != (int64_t)AV_NOPTS_VALUE)
tag->time = f->duration / AV_TIME_BASE;
#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
av_metadata_conv(f, NULL, f->iformat->metadata_conv);
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_TITLE, "title");
if (!ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ARTIST, "author"))
ffmpeg_copy_metadata(tag, f->metadata,
TAG_ITEM_ARTIST, "artist");
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ARTIST, "author");
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ALBUM, "album");
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_COMMENT, "comment");
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_GENRE, "genre");

@@ -629,21 +629,15 @@ flac_container_decode(struct decoder* decoder,
FLAC__uint64 seek_sample = t_start +
(decoder_seek_where(decoder) * data.audio_format.sample_rate);
//if (seek_sample >= t_start && seek_sample <= t_end && data.total_time > 30)
if (seek_sample >= t_start && seek_sample <= t_end)
{
if (flac_seek_absolute(flac_dec, (FLAC__uint64)seek_sample))
{
data.time = (float)(seek_sample - t_start) /
data.audio_format.sample_rate;
data.position = 0;
if (seek_sample >= t_start && seek_sample <= t_end &&
flac_seek_absolute(flac_dec, (FLAC__uint64)seek_sample)) {
data.time = (float)(seek_sample - t_start) /
data.audio_format.sample_rate;
data.position = 0;
decoder_command_finished(decoder);
}
else
decoder_seek_error(decoder);
//decoder_command_finished(decoder);
}
decoder_command_finished(decoder);
} else
decoder_seek_error(decoder);
}
else if (flac_get_state(flac_dec) == flac_decoder_eof)
break;

@@ -272,6 +272,10 @@ oggflac_tag_dup(const char *file)
return NULL;
}
/* rewind the stream, because ogg_stream_type_detect() has
moved it */
input_stream_seek(&input_stream, 0, SEEK_SET);
flac_data_init(&data, NULL, &input_stream);
data.tag = tag_new();
@@ -300,6 +304,10 @@ oggflac_decode(struct decoder * mpd_decoder, struct input_stream *input_stream)
if (ogg_stream_type_detect(input_stream) != FLAC)
return;
/* rewind the stream, because ogg_stream_type_detect() has
moved it */
input_stream_seek(input_stream, 0, SEEK_SET);
flac_data_init(&data, mpd_decoder, input_stream);
if (!(decoder = full_decoder_init_and_read_metadata(&data, 0))) {

@@ -26,9 +26,6 @@
#include <assert.h>
#define DECODE_TYPE_FILE 0
#define DECODE_TYPE_URL 1
enum decoder_state {
DECODE_STATE_STOP = 0,
DECODE_STATE_START,

@@ -112,7 +112,7 @@ lastfm_input_open(struct input_stream *is, const char *url)
#if GLIB_CHECK_VERSION(2,16,0)
q = g_uri_escape_string(lastfm_user, NULL, false);
#else
q = g_strdup(lastfm_username);
q = g_strdup(lastfm_user);
#endif
#if GLIB_CHECK_VERSION(2,16,0)

@@ -248,6 +248,15 @@ static gpointer audio_output_task(gpointer arg)
break;
case AO_COMMAND_PAUSE:
if (!ao->open) {
/* the output has failed after
audio_output_all_pause() has
submitted the PAUSE command; bail
out */
ao_command_finished(ao);
break;
}
ao_pause(ao);
/* don't "break" here: this might cause
ao_play() to be called when command==CLOSE

@@ -21,7 +21,6 @@
#include "song.h"
#include "tag_save.h"
#include "directory.h"
#include "path.h"
#include "tag.h"
#include <glib.h>
@@ -113,12 +112,15 @@ matchesAnMpdTagItemKey(char *buffer, enum tag_type *itemType)
void readSongInfoIntoList(FILE *fp, struct songvec *sv,
struct directory *parent)
{
char buffer[MPD_PATH_MAX + 1024];
enum {
buffer_size = 32768,
};
char *buffer = g_malloc(buffer_size);
struct song *song = NULL;
enum tag_type itemType;
const char *value;
while (fgets(buffer, sizeof(buffer), fp) &&
while (fgets(buffer, buffer_size, fp) &&
!g_str_has_prefix(buffer, SONG_END)) {
g_strchomp(buffer);
@@ -156,6 +158,8 @@ void readSongInfoIntoList(FILE *fp, struct songvec *sv,
g_error("unknown line in db: %s", buffer);
}
g_free(buffer);
if (song)
insertSongIntoList(sv, song);
}

@@ -27,6 +27,10 @@
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "sticker"
#if SQLITE_VERSION_NUMBER < 3003009
#define sqlite3_prepare_v2 sqlite3_prepare
#endif
struct sticker {
GHashTable *table;
};

@@ -481,7 +481,7 @@ tag_id3_riff_aiff_load(FILE *file)
if (size == 0)
return NULL;
if (size > 256 * 1024)
if (size > 4 * 1024 * 1024)
/* too large, don't allocate so much memory */
return NULL;

@@ -672,7 +672,11 @@ updateDirectory(struct directory *directory, const struct stat *st)
continue;
utf8 = fs_charset_to_utf8(ent->d_name);
if (utf8 == NULL || skip_symlink(directory, utf8)) {
if (utf8 == NULL)
continue;
if (skip_symlink(directory, utf8)) {
delete_name_in(directory, utf8);
g_free(utf8);
continue;
}