Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
30847e6c77 | ||
![]() |
97f8e017c4 | ||
![]() |
f51ba6464a | ||
![]() |
77b95d08a5 | ||
![]() |
dca4d9cf83 | ||
![]() |
68f77e4163 | ||
![]() |
93a13b42dd | ||
![]() |
96fcf5e1a5 | ||
![]() |
937b2b1744 | ||
![]() |
8c0680f6b9 | ||
![]() |
b242175e18 | ||
![]() |
3de912e2b9 | ||
![]() |
04816a6369 | ||
![]() |
d083032236 | ||
![]() |
1a6ed81193 | ||
![]() |
b2b300b635 |
20
NEWS
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user