diff options
author | 2010-05-29 22:07:29 +0200 | |
---|---|---|
committer | 2010-05-29 22:07:29 +0200 | |
commit | f352b303ed532c255848457d0672eccc6aa0563f (patch) | |
tree | 29ebbcb06e4d928c568ffedeb541ca67c9a1a89f /plugins | |
parent | 43b6c898a2de5af40b0c627b44528ac2c966034a (diff) | |
parent | d7bd305652adf193d942eda62314408ecfbcd3b4 (diff) |
Merge branch 'master' into i18n
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/artwork/artwork.c | 4 | ||||
-rw-r--r-- | plugins/ffmpeg/ffmpeg.c | 5 | ||||
-rw-r--r-- | plugins/gtkui/coverart.c | 10 | ||||
-rw-r--r-- | plugins/gtkui/ddblistview.c | 2 | ||||
-rw-r--r-- | plugins/wavpack/wavpack.c | 19 |
5 files changed, 32 insertions, 8 deletions
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 88052e6e..8bd336ad 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -229,7 +229,7 @@ id3v2_skip_str (int enc, uint8_t *ptr, uint8_t *end) { } else { while (ptr < end-1 && (ptr[0] || ptr[1])) { - ptr++; + ptr += 2; } ptr += 2; if (ptr >= end) { @@ -437,7 +437,7 @@ fetcher_thread (void *none) char* get_album_art (const char *fname, const char *artist, const char *album, artwork_callback callback, void *user_data) { - trace ("get_album_art: %s (%s - %s)\n", fname, artist, album); +// trace ("get_album_art: %s (%s - %s)\n", fname, artist, album); char path [1024]; if (!album) { diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c index 2a9ac0bc..fd220fbf 100644 --- a/plugins/ffmpeg/ffmpeg.c +++ b/plugins/ffmpeg/ffmpeg.c @@ -55,7 +55,7 @@ static DB_decoder_t plugin; static DB_functions_t *deadbeef; -static const char * exts[] = { "m4a", "mpc", "mp+", "mpp", "wma", "shn", "aa3", "oma", "ac3", "vqf", "tta", NULL }; +static const char * exts[] = { "m4a", "mp4", "mpc", "mp+", "mpp", "wma", "shn", "aa3", "oma", "ac3", "vqf", "tta", NULL }; enum { FT_AAC = 0, @@ -520,6 +520,9 @@ ffmpeg_insert (DB_playItem_t *after, const char *fname) { if (!strcasecmp (ext, "m4a")) { filetype = filetypes[FT_M4A]; } + else if (!strcasecmp (ext, "mp4")) { + filetype = filetypes[FT_M4A]; + } else if (!strcasecmp (ext, "mpc") || !strcasecmp (ext, "mp+") || !strcasecmp (ext, "mpp")) { filetype = filetypes[FT_MUSEPACK]; } diff --git a/plugins/gtkui/coverart.c b/plugins/gtkui/coverart.c index d5f34c26..7fb50554 100644 --- a/plugins/gtkui/coverart.c +++ b/plugins/gtkui/coverart.c @@ -142,16 +142,24 @@ loading_thread (void *none) { } // GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (queue->fname, NULL); - GError *error; + GError *error = NULL; GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_scale (queue->fname, queue->width, queue->width, TRUE, &error); if (!pixbuf) { unlink (queue->fname); fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", queue->fname, queue->width, error->message); + if (error) { + g_error_free (error); + error = NULL; + } pixbuf = gdk_pixbuf_new_from_file_at_scale (DEFAULT_COVER_PATH, queue->width, queue->width, TRUE, &error); if (!pixbuf) { fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", DEFAULT_COVER_PATH, queue->width, error->message); } } + if (error) { + g_error_free (error); + error = NULL; + } if (!pixbuf) { // make default empty image pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 2, 2); diff --git a/plugins/gtkui/ddblistview.c b/plugins/gtkui/ddblistview.c index 7156f147..cfb82cbf 100644 --- a/plugins/gtkui/ddblistview.c +++ b/plugins/gtkui/ddblistview.c @@ -36,8 +36,6 @@ #include "drawing.h" #include "gtkui.h" -#pragma GCC optimize("O0") - #define min(x,y) ((x)<(y)?(x):(y)) #define max(x,y) ((x)>(y)?(x):(y)) diff --git a/plugins/wavpack/wavpack.c b/plugins/wavpack/wavpack.c index e2f9e43b..861dec75 100644 --- a/plugins/wavpack/wavpack.c +++ b/plugins/wavpack/wavpack.c @@ -34,7 +34,7 @@ static DB_functions_t *deadbeef; typedef struct { DB_fileinfo_t info; - DB_FILE *file; + DB_FILE *file, *c_file; WavpackContext *ctx; int startsample; int endsample; @@ -105,8 +105,19 @@ wv_init (DB_fileinfo_t *_info, DB_playItem_t *it) { if (!info->file) { return -1; } + + char *c_fname = alloca (strlen (it->fname) + 2); + if (c_fname) { + strcpy (c_fname, it->fname); + strcat (c_fname, "c"); + info->c_file = deadbeef->fopen (c_fname); + } + else { + fprintf (stderr, "wavpack warning: failed to alloc memory for correction file name\n"); + } + char error[80]; - info->ctx = WavpackOpenFileInputEx (&wsr, info->file, NULL, error, OPEN_2CH_MAX/*|OPEN_WVC*/, 0); + info->ctx = WavpackOpenFileInputEx (&wsr, info->file, info->c_file, error, OPEN_2CH_MAX, 0); if (!info->ctx) { fprintf (stderr, "wavpack error: %s\n", error); return -1; @@ -138,6 +149,10 @@ wv_free (DB_fileinfo_t *_info) { deadbeef->fclose (info->file); info->file = NULL; } + if (info->c_file) { + deadbeef->fclose (info->c_file); + info->c_file = NULL; + } if (info->ctx) { WavpackCloseFile (info->ctx); info->ctx = NULL; |