From a0d3c07df36f17a0ce22cc81ce9770dc9ab6549e Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Mon, 23 Jun 2014 21:59:50 +0200 Subject: flac: ignore embedded flac cuesheet metadata block if it's out of file bounds --- plugins/flac/flac.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'plugins') diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c index 977298b0..0332ecc3 100644 --- a/plugins/flac/flac.c +++ b/plugins/flac/flac.c @@ -620,6 +620,15 @@ cflac_init_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__Str static DB_playItem_t * cflac_insert_with_embedded_cue (ddb_playlist_t *plt, DB_playItem_t *after, DB_playItem_t *origin, const FLAC__StreamMetadata_CueSheet *cuesheet, int totalsamples, int samplerate) { DB_playItem_t *ins = after; + + // first check if cuesheet is matching the data + for (int i = 0; i < cuesheet->num_tracks-1; i++) { + if (cuesheet->tracks[i].offset + cuesheet->tracks[i+1].offset-1 > totalsamples) { + fprintf (stderr, "The flac %s has invalid embedded cuesheet. You should remove it using metaflac.\n", deadbeef->pl_find_meta_raw (origin, ":URI")); + return NULL; + } + } + for (int i = 0; i < cuesheet->num_tracks-1; i++) { const char *uri = deadbeef->pl_find_meta_raw (origin, ":URI"); const char *dec = deadbeef->pl_find_meta_raw (origin, ":DECODER"); -- cgit v1.2.3 From 7c1364b0e5c24cad204b69b1ceb2fc2758548d17 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 24 Jun 2014 09:20:30 +0200 Subject: flac: fixed cuesheet validation --- plugins/flac/flac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c index 0332ecc3..fc7bbe5b 100644 --- a/plugins/flac/flac.c +++ b/plugins/flac/flac.c @@ -622,8 +622,8 @@ cflac_insert_with_embedded_cue (ddb_playlist_t *plt, DB_playItem_t *after, DB_pl DB_playItem_t *ins = after; // first check if cuesheet is matching the data - for (int i = 0; i < cuesheet->num_tracks-1; i++) { - if (cuesheet->tracks[i].offset + cuesheet->tracks[i+1].offset-1 > totalsamples) { + for (int i = 0; i < cuesheet->num_tracks; i++) { + if (cuesheet->tracks[i].offset >= totalsamples) { fprintf (stderr, "The flac %s has invalid embedded cuesheet. You should remove it using metaflac.\n", deadbeef->pl_find_meta_raw (origin, ":URI")); return NULL; } -- cgit v1.2.3 From 9c544c03c095115dce261b928334cdf81ae34203 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 24 Jun 2014 20:15:12 +0200 Subject: wma: use the new open2 API to make it possible to interrupt hanging streams without blocking on "init" --- plugins/wma/wma_plugin.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/wma/wma_plugin.c b/plugins/wma/wma_plugin.c index 71c70a2e..8bee83e2 100644 --- a/plugins/wma/wma_plugin.c +++ b/plugins/wma/wma_plugin.c @@ -63,6 +63,7 @@ typedef struct { int skipsamples; char buffer[200000]; // can't predict its size, so set to max int remaining; + int open2_was_used; } wmaplug_info_t; // allocate codec control structure @@ -71,6 +72,23 @@ wmaplug_open (uint32_t hints) { DB_fileinfo_t *_info = malloc (sizeof (wmaplug_info_t)); wmaplug_info_t *info = (wmaplug_info_t *)_info; memset (info, 0, sizeof (wmaplug_info_t)); + + return _info; +} + +static DB_fileinfo_t * +wmaplug_open2 (uint32_t hints, DB_playItem_t *it) { + DB_FILE *file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI")); + if (!file) { + return NULL; + } + + DB_fileinfo_t *_info = malloc (sizeof (wmaplug_info_t)); + wmaplug_info_t *info = (wmaplug_info_t *)_info; + memset (info, 0, sizeof (wmaplug_info_t)); + info->open2_was_used = 1; + info->info.file = file; + return _info; } @@ -80,7 +98,10 @@ static int wmaplug_init (DB_fileinfo_t *_info, DB_playItem_t *it) { wmaplug_info_t *info = (wmaplug_info_t *)_info; - info->info.file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI")); + if (!info->open2_was_used) { + info->info.file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI")); + } + if (!info->info.file) { return -1; } @@ -457,7 +478,7 @@ static const char * exts[] = { "wma", NULL }; // define plugin interface static DB_decoder_t plugin = { .plugin.api_vmajor = 1, - .plugin.api_vminor = 0, + .plugin.api_vminor = 7, .plugin.version_major = 1, .plugin.version_minor = 0, .plugin.type = DB_PLUGIN_DECODER, @@ -489,6 +510,7 @@ static DB_decoder_t plugin = { , .plugin.website = "http://deadbeef.sf.net", .open = wmaplug_open, + .open2 = wmaplug_open2, .init = wmaplug_init, .free = wmaplug_free, .read = wmaplug_read, -- cgit v1.2.3 From 40096d01c93b5b6d58b26a183b5cb641277ec52e Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 24 Jun 2014 20:41:29 +0200 Subject: flac: added vfs support to read_metadata; fixed reading vorbiscomment metadata block from end of stream --- plugins/flac/flac.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c index fc7bbe5b..71d64f0a 100644 --- a/plugins/flac/flac.c +++ b/plugins/flac/flac.c @@ -81,6 +81,8 @@ typedef struct { const char *fname; int bitrate; FLAC__StreamMetadata *flac_cue_sheet; + + int got_vorbis_comments; } flac_info_t; // callbacks @@ -609,6 +611,7 @@ cflac_init_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__Str f |= DDB_TAG_VORBISCOMMENTS; deadbeef->pl_set_item_flags (it, f); } + info->got_vorbis_comments = 1; } else if (metadata->type == FLAC__METADATA_TYPE_CUESHEET) { if (!info->flac_cue_sheet) { @@ -691,6 +694,8 @@ cflac_free_temp (DB_fileinfo_t *_info) { } } +static int +cflac_read_metadata (DB_playItem_t *it); static DB_playItem_t * cflac_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { @@ -786,11 +791,12 @@ cflac_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { if (info.info.fmt.samplerate <= 0) { goto cflac_insert_fail; } + int64_t fsize = deadbeef->fgetlength (info.file); + int is_streaming = info.file->vfs->is_streaming (); deadbeef->pl_add_meta (it, ":FILETYPE", isogg ? "OggFLAC" : "FLAC"); char s[100]; - int64_t fsize = deadbeef->fgetlength (info.file); snprintf (s, sizeof (s), "%lld", fsize); deadbeef->pl_add_meta (it, ":FILE_SIZE", s); snprintf (s, sizeof (s), "%d", info.info.fmt.channels); @@ -817,6 +823,13 @@ cflac_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { FLAC__stream_decoder_delete(decoder); decoder = NULL; + deadbeef->fclose (info.file); + info.file = NULL; + + if (!info.got_vorbis_comments && !is_streaming) { + cflac_read_metadata (it); + } + // try embedded cue deadbeef->pl_lock (); if (info.flac_cue_sheet) { @@ -865,7 +878,43 @@ cflac_insert_fail: return NULL; } -int +static size_t +flac_io_read (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle) { + return deadbeef->fread (ptr, size, nmemb, (DB_FILE *)handle); +} + +static int +flac_io_seek (FLAC__IOHandle handle, FLAC__int64 offset, int whence) { + return deadbeef->fseek ((DB_FILE *)handle, offset, whence); +} + +static FLAC__int64 +flac_io_tell (FLAC__IOHandle handle) { + return deadbeef->ftell ((DB_FILE *)handle); +} + +static int +flac_io_eof (FLAC__IOHandle handle) { + int64_t pos = deadbeef->ftell ((DB_FILE *)handle); + return pos == deadbeef->fgetlength ((DB_FILE *)handle); +} + +static int +flac_io_close (FLAC__IOHandle handle) { + deadbeef->fclose ((DB_FILE *)handle); + return 0; +} + +static FLAC__IOCallbacks iocb = { + .read = flac_io_read, + .write = NULL, + .seek = flac_io_seek, + .tell = flac_io_tell, + .eof = flac_io_eof, + .close = flac_io_close, +}; + +static int cflac_read_metadata (DB_playItem_t *it) { int err = -1; FLAC__Metadata_Chain *chain = NULL; @@ -877,11 +926,17 @@ cflac_read_metadata (DB_playItem_t *it) { return -1; } deadbeef->pl_lock (); - FLAC__bool res = FLAC__metadata_chain_read (chain, deadbeef->pl_find_meta (it, ":URI")); + DB_FILE *file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI")); + deadbeef->pl_unlock (); + if (!file) { + return -1; + } + FLAC__bool res = FLAC__metadata_chain_read_with_callbacks (chain, (FLAC__IOHandle)file, iocb); if (!res && FLAC__metadata_chain_status(chain) == FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE) { - res = FLAC__metadata_chain_read_ogg (chain, deadbeef->pl_find_meta (it, ":URI")); + res = FLAC__metadata_chain_read_ogg_with_callbacks (chain, (FLAC__IOHandle)file, iocb); } - deadbeef->pl_unlock (); + deadbeef->fclose (file); + file = NULL; if (!res) { trace ("cflac_read_metadata: FLAC__metadata_chain_read(_ogg) failed\n"); goto error; @@ -968,15 +1023,21 @@ cflac_write_metadata (DB_playItem_t *it) { return -1; } deadbeef->pl_lock (); - FLAC__bool res = FLAC__metadata_chain_read (chain, deadbeef->pl_find_meta (it, ":URI")); + DB_FILE *file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI")); + deadbeef->pl_unlock (); + if (!file) { + return -1; + } + FLAC__bool res = FLAC__metadata_chain_read_with_callbacks (chain, (FLAC__IOHandle)file, iocb); FLAC__bool isogg = false; #if USE_OGGEDIT if (!res && FLAC__metadata_chain_status(chain) == FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE) { isogg = true; - res = FLAC__metadata_chain_read_ogg (chain, deadbeef->pl_find_meta (it, ":URI")); + res = FLAC__metadata_chain_read_ogg_with_callbacks (chain, (FLAC__IOHandle)file, iocb); } #endif - deadbeef->pl_unlock (); + deadbeef->fclose (file); + file = NULL; if (!res) { trace ("cflac_write_metadata: FLAC__metadata_chain_read(_ogg) failed - code %d\n", res); goto error; -- cgit v1.2.3 From 328e87cc94bb0204ba557534c53f7c58c67b1580 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 24 Jun 2014 20:46:20 +0200 Subject: artwork: added vfs support for reading from flacs --- plugins/artwork/artwork.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 9a3caa76..612e4f1e 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -906,6 +906,43 @@ id3v2_skip_str (int enc, uint8_t *ptr, uint8_t *end) { return NULL; } +#ifdef USE_METAFLAC +static size_t +flac_io_read (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle) { + return deadbeef->fread (ptr, size, nmemb, (DB_FILE *)handle); +} + +static int +flac_io_seek (FLAC__IOHandle handle, FLAC__int64 offset, int whence) { + return deadbeef->fseek ((DB_FILE *)handle, offset, whence); +} + +static FLAC__int64 +flac_io_tell (FLAC__IOHandle handle) { + return deadbeef->ftell ((DB_FILE *)handle); +} + +static int +flac_io_eof (FLAC__IOHandle handle) { + int64_t pos = deadbeef->ftell ((DB_FILE *)handle); + return pos == deadbeef->fgetlength ((DB_FILE *)handle); +} + +static int +flac_io_close (FLAC__IOHandle handle) { + deadbeef->fclose ((DB_FILE *)handle); + return 0; +} + +static FLAC__IOCallbacks iocb = { + .read = flac_io_read, + .write = NULL, + .seek = flac_io_seek, + .tell = flac_io_tell, + .eof = flac_io_eof, + .close = flac_io_close, +}; +#endif static void fetcher_thread (void *none) @@ -1112,11 +1149,18 @@ fetcher_thread (void *none) is_ogg = 1; } - if(! (is_ogg? FLAC__metadata_chain_read_ogg(chain, filename) : FLAC__metadata_chain_read(chain, filename)) ) { + DB_FILE *file = deadbeef->fopen (filename); + if (!file) { + break; + } + + if(! (is_ogg? FLAC__metadata_chain_read_ogg_with_callbacks(chain, (FLAC__IOHandle)file, iocb) : FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, iocb)) ) { trace ("%s: ERROR: reading metadata", filename); + deadbeef->fclose (file); FLAC__metadata_chain_delete(chain); break; } + deadbeef->fclose (file); FLAC__StreamMetadata *picture = 0; FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); FLAC__metadata_iterator_init(iterator, chain); -- cgit v1.2.3 From a9c64cfd3db24a00fc4ff5159599ad1d3e31343b Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 24 Jun 2014 22:50:35 +0200 Subject: liboggedit: added missing curly braces --- plugins/liboggedit/oggedit_internal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/liboggedit/oggedit_internal.c b/plugins/liboggedit/oggedit_internal.c index f3c9b2d9..c8257da5 100644 --- a/plugins/liboggedit/oggedit_internal.c +++ b/plugins/liboggedit/oggedit_internal.c @@ -142,8 +142,9 @@ int open_temp_file(const char *fname, char *tempname, FILE **out) return OGGEDIT_CANNOT_OPEN_TEMPORARY_FILE; struct stat stat_struct; - if (!stat(fname, &stat_struct)) + if (!stat(fname, &stat_struct)) { chmod(tempname, stat_struct.st_mode); + } return 0; } -- cgit v1.2.3 From e4dcbc4a3285130b14853da94dab5ea23c11119d Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Wed, 25 Jun 2014 16:43:01 +0200 Subject: flac: fixed tag writing regression and related error reporting --- plugins/flac/flac.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'plugins') diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c index 71d64f0a..93ed1224 100644 --- a/plugins/flac/flac.c +++ b/plugins/flac/flac.c @@ -1019,27 +1019,21 @@ cflac_write_metadata (DB_playItem_t *it) { chain = FLAC__metadata_chain_new (); if (!chain) { - trace ("cflac_write_metadata: FLAC__metadata_chain_new failed\n"); + fprintf (stderr, "cflac_write_metadata: FLAC__metadata_chain_new failed\n"); return -1; } deadbeef->pl_lock (); - DB_FILE *file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI")); - deadbeef->pl_unlock (); - if (!file) { - return -1; - } - FLAC__bool res = FLAC__metadata_chain_read_with_callbacks (chain, (FLAC__IOHandle)file, iocb); + FLAC__bool res = FLAC__metadata_chain_read (chain, deadbeef->pl_find_meta (it, ":URI")); FLAC__bool isogg = false; #if USE_OGGEDIT if (!res && FLAC__metadata_chain_status(chain) == FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE) { isogg = true; - res = FLAC__metadata_chain_read_ogg_with_callbacks (chain, (FLAC__IOHandle)file, iocb); + res = FLAC__metadata_chain_read_ogg (chain, deadbeef->pl_find_meta (it, ":URI")); } #endif - deadbeef->fclose (file); - file = NULL; + deadbeef->pl_unlock (); if (!res) { - trace ("cflac_write_metadata: FLAC__metadata_chain_read(_ogg) failed - code %d\n", res); + fprintf (stderr, "cflac_write_metadata: FLAC__metadata_chain_read(_ogg) failed - code %d\n", res); goto error; } FLAC__metadata_chain_merge_padding (chain); @@ -1140,11 +1134,13 @@ cflac_write_metadata (DB_playItem_t *it) { } #if USE_OGGEDIT else { - res = cflac_write_metadata_ogg(it, &data->data.vorbis_comment); + if (cflac_write_metadata_ogg(it, &data->data.vorbis_comment)) { + res = 0; + } } #endif - if (res) { - trace ("cflac_write_metadata: failed to write tags: code %d\n", res); + if (!res) { + fprintf (stderr, "cflac_write_metadata: failed to write tags: code %d\n", res); goto error; } -- cgit v1.2.3 From ed1d8f2fa9f174780cdfb518f1a144bb0aaf42e9 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Wed, 25 Jun 2014 19:50:05 +0200 Subject: gtkui: fixed "Set custom title" string --- plugins/gtkui/deadbeef.glade | 2 +- plugins/gtkui/interface.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade index 57dd0cbe..d95ca35f 100644 --- a/plugins/gtkui/deadbeef.glade +++ b/plugins/gtkui/deadbeef.glade @@ -6349,7 +6349,7 @@ if you don't press Apply. True True - Set custom title + Set Custom Title True GTK_RELIEF_NORMAL True diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c index c4c02b73..b4b58f99 100644 --- a/plugins/gtkui/interface.c +++ b/plugins/gtkui/interface.c @@ -3225,7 +3225,7 @@ create_addlocationdlg (void) hbox122 = gtk_hbox_new (FALSE, 8); gtk_box_pack_start (GTK_BOX (vbox45), hbox122, TRUE, TRUE, 0); - set_custom_title = gtk_check_button_new_with_mnemonic (_("Set custom title")); + set_custom_title = gtk_check_button_new_with_mnemonic (_("Set Custom Title")); gtk_widget_show (set_custom_title); gtk_box_pack_start (GTK_BOX (hbox122), set_custom_title, FALSE, FALSE, 0); -- cgit v1.2.3 From bacb80dec4bbe61e7ecfd02628b043a51affeb42 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Wed, 25 Jun 2014 19:55:15 +0200 Subject: gtkui: another fix for "set custom title" text --- plugins/gtkui/deadbeef.glade | 2 +- plugins/gtkui/interface.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade index d95ca35f..59ac4533 100644 --- a/plugins/gtkui/deadbeef.glade +++ b/plugins/gtkui/deadbeef.glade @@ -8827,7 +8827,7 @@ Descending True True - Set custom title + Set Custom Title True GTK_RELIEF_NORMAL True diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c index b4b58f99..d17269c6 100644 --- a/plugins/gtkui/interface.c +++ b/plugins/gtkui/interface.c @@ -4439,7 +4439,7 @@ create_setcustomtitledlg (void) gtk_widget_show (hbox123); gtk_box_pack_start (GTK_BOX (vbox46), hbox123, FALSE, TRUE, 0); - set_custom_title = gtk_check_button_new_with_mnemonic (_("Set custom title")); + set_custom_title = gtk_check_button_new_with_mnemonic (_("Set Custom Title")); gtk_widget_show (set_custom_title); gtk_box_pack_start (GTK_BOX (hbox123), set_custom_title, FALSE, FALSE, 0); -- cgit v1.2.3 From 290c8fe11dc67b0ef04b605355ad3d4a455c6c15 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Wed, 25 Jun 2014 20:26:08 +0200 Subject: m3u: fixed reading pls files which have spaces before and/or after the "=" sign --- plugins/m3u/m3u.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/m3u/m3u.c b/plugins/m3u/m3u.c index 56602c4c..ff3320b5 100644 --- a/plugins/m3u/m3u.c +++ b/plugins/m3u/m3u.c @@ -322,16 +322,9 @@ load_pls (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pab } const uint8_t *e; int n; - if (!strncasecmp (p, "numberofentries=", 16) || !strncasecmp (p, "version=", 8)) { - while (p < end && *p >= 0x20) { - p++; - } - continue; - } - else if (!strncasecmp (p, "file", 4)) { + if (!strncasecmp (p, "file", 4)) { int idx = atoi (p + 4); if (uri[0] && idx != lastidx && lastidx != -1) { - trace ("uri%d\n", idx); DB_playItem_t *it = pls_insert_file (plt, after, fname, uri, pabort, cb, user_data, title, length); if (it) { after = it; @@ -350,6 +343,9 @@ load_pls (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pab p++; } p++; + while (p < end && *p <= 0x20) { + p++; + } if (p >= end) { break; } @@ -387,6 +383,9 @@ load_pls (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pab p++; } p++; + while (p < end && *p <= 0x20) { + p++; + } if (p >= end) { break; } -- cgit v1.2.3 From 77936c7082fb7a7cabf8e33b0d39412c7c6c8726 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Wed, 25 Jun 2014 20:33:45 +0200 Subject: ao: added static to all INLINEs --- plugins/ao/eng_qsf/z80.c | 166 +++++++++++++++++++++++------------------------ 1 file changed, 83 insertions(+), 83 deletions(-) (limited to 'plugins') diff --git a/plugins/ao/eng_qsf/z80.c b/plugins/ao/eng_qsf/z80.c index ddcd57ce..91e873a3 100644 --- a/plugins/ao/eng_qsf/z80.c +++ b/plugins/ao/eng_qsf/z80.c @@ -277,70 +277,70 @@ static void take_interrupt(z80_state_t *z80); typedef void (*funcptr)(z80_state_t *z80); #define PROTOTYPES(tablename,prefix) \ - INLINE void prefix##_00(z80_state_t *z80); INLINE void prefix##_01(z80_state_t *z80); INLINE void prefix##_02(z80_state_t *z80); INLINE void prefix##_03(z80_state_t *z80); \ - INLINE void prefix##_04(z80_state_t *z80); INLINE void prefix##_05(z80_state_t *z80); INLINE void prefix##_06(z80_state_t *z80); INLINE void prefix##_07(z80_state_t *z80); \ - INLINE void prefix##_08(z80_state_t *z80); INLINE void prefix##_09(z80_state_t *z80); INLINE void prefix##_0a(z80_state_t *z80); INLINE void prefix##_0b(z80_state_t *z80); \ - INLINE void prefix##_0c(z80_state_t *z80); INLINE void prefix##_0d(z80_state_t *z80); INLINE void prefix##_0e(z80_state_t *z80); INLINE void prefix##_0f(z80_state_t *z80); \ - INLINE void prefix##_10(z80_state_t *z80); INLINE void prefix##_11(z80_state_t *z80); INLINE void prefix##_12(z80_state_t *z80); INLINE void prefix##_13(z80_state_t *z80); \ - INLINE void prefix##_14(z80_state_t *z80); INLINE void prefix##_15(z80_state_t *z80); INLINE void prefix##_16(z80_state_t *z80); INLINE void prefix##_17(z80_state_t *z80); \ - INLINE void prefix##_18(z80_state_t *z80); INLINE void prefix##_19(z80_state_t *z80); INLINE void prefix##_1a(z80_state_t *z80); INLINE void prefix##_1b(z80_state_t *z80); \ - INLINE void prefix##_1c(z80_state_t *z80); INLINE void prefix##_1d(z80_state_t *z80); INLINE void prefix##_1e(z80_state_t *z80); INLINE void prefix##_1f(z80_state_t *z80); \ - INLINE void prefix##_20(z80_state_t *z80); INLINE void prefix##_21(z80_state_t *z80); INLINE void prefix##_22(z80_state_t *z80); INLINE void prefix##_23(z80_state_t *z80); \ - INLINE void prefix##_24(z80_state_t *z80); INLINE void prefix##_25(z80_state_t *z80); INLINE void prefix##_26(z80_state_t *z80); INLINE void prefix##_27(z80_state_t *z80); \ - INLINE void prefix##_28(z80_state_t *z80); INLINE void prefix##_29(z80_state_t *z80); INLINE void prefix##_2a(z80_state_t *z80); INLINE void prefix##_2b(z80_state_t *z80); \ - INLINE void prefix##_2c(z80_state_t *z80); INLINE void prefix##_2d(z80_state_t *z80); INLINE void prefix##_2e(z80_state_t *z80); INLINE void prefix##_2f(z80_state_t *z80); \ - INLINE void prefix##_30(z80_state_t *z80); INLINE void prefix##_31(z80_state_t *z80); INLINE void prefix##_32(z80_state_t *z80); INLINE void prefix##_33(z80_state_t *z80); \ - INLINE void prefix##_34(z80_state_t *z80); INLINE void prefix##_35(z80_state_t *z80); INLINE void prefix##_36(z80_state_t *z80); INLINE void prefix##_37(z80_state_t *z80); \ - INLINE void prefix##_38(z80_state_t *z80); INLINE void prefix##_39(z80_state_t *z80); INLINE void prefix##_3a(z80_state_t *z80); INLINE void prefix##_3b(z80_state_t *z80); \ - INLINE void prefix##_3c(z80_state_t *z80); INLINE void prefix##_3d(z80_state_t *z80); INLINE void prefix##_3e(z80_state_t *z80); INLINE void prefix##_3f(z80_state_t *z80); \ - INLINE void prefix##_40(z80_state_t *z80); INLINE void prefix##_41(z80_state_t *z80); INLINE void prefix##_42(z80_state_t *z80); INLINE void prefix##_43(z80_state_t *z80); \ - INLINE void prefix##_44(z80_state_t *z80); INLINE void prefix##_45(z80_state_t *z80); INLINE void prefix##_46(z80_state_t *z80); INLINE void prefix##_47(z80_state_t *z80); \ - INLINE void prefix##_48(z80_state_t *z80); INLINE void prefix##_49(z80_state_t *z80); INLINE void prefix##_4a(z80_state_t *z80); INLINE void prefix##_4b(z80_state_t *z80); \ - INLINE void prefix##_4c(z80_state_t *z80); INLINE void prefix##_4d(z80_state_t *z80); INLINE void prefix##_4e(z80_state_t *z80); INLINE void prefix##_4f(z80_state_t *z80); \ - INLINE void prefix##_50(z80_state_t *z80); INLINE void prefix##_51(z80_state_t *z80); INLINE void prefix##_52(z80_state_t *z80); INLINE void prefix##_53(z80_state_t *z80); \ - INLINE void prefix##_54(z80_state_t *z80); INLINE void prefix##_55(z80_state_t *z80); INLINE void prefix##_56(z80_state_t *z80); INLINE void prefix##_57(z80_state_t *z80); \ - INLINE void prefix##_58(z80_state_t *z80); INLINE void prefix##_59(z80_state_t *z80); INLINE void prefix##_5a(z80_state_t *z80); INLINE void prefix##_5b(z80_state_t *z80); \ - INLINE void prefix##_5c(z80_state_t *z80); INLINE void prefix##_5d(z80_state_t *z80); INLINE void prefix##_5e(z80_state_t *z80); INLINE void prefix##_5f(z80_state_t *z80); \ - INLINE void prefix##_60(z80_state_t *z80); INLINE void prefix##_61(z80_state_t *z80); INLINE void prefix##_62(z80_state_t *z80); INLINE void prefix##_63(z80_state_t *z80); \ - INLINE void prefix##_64(z80_state_t *z80); INLINE void prefix##_65(z80_state_t *z80); INLINE void prefix##_66(z80_state_t *z80); INLINE void prefix##_67(z80_state_t *z80); \ - INLINE void prefix##_68(z80_state_t *z80); INLINE void prefix##_69(z80_state_t *z80); INLINE void prefix##_6a(z80_state_t *z80); INLINE void prefix##_6b(z80_state_t *z80); \ - INLINE void prefix##_6c(z80_state_t *z80); INLINE void prefix##_6d(z80_state_t *z80); INLINE void prefix##_6e(z80_state_t *z80); INLINE void prefix##_6f(z80_state_t *z80); \ - INLINE void prefix##_70(z80_state_t *z80); INLINE void prefix##_71(z80_state_t *z80); INLINE void prefix##_72(z80_state_t *z80); INLINE void prefix##_73(z80_state_t *z80); \ - INLINE void prefix##_74(z80_state_t *z80); INLINE void prefix##_75(z80_state_t *z80); INLINE void prefix##_76(z80_state_t *z80); INLINE void prefix##_77(z80_state_t *z80); \ - INLINE void prefix##_78(z80_state_t *z80); INLINE void prefix##_79(z80_state_t *z80); INLINE void prefix##_7a(z80_state_t *z80); INLINE void prefix##_7b(z80_state_t *z80); \ - INLINE void prefix##_7c(z80_state_t *z80); INLINE void prefix##_7d(z80_state_t *z80); INLINE void prefix##_7e(z80_state_t *z80); INLINE void prefix##_7f(z80_state_t *z80); \ - INLINE void prefix##_80(z80_state_t *z80); INLINE void prefix##_81(z80_state_t *z80); INLINE void prefix##_82(z80_state_t *z80); INLINE void prefix##_83(z80_state_t *z80); \ - INLINE void prefix##_84(z80_state_t *z80); INLINE void prefix##_85(z80_state_t *z80); INLINE void prefix##_86(z80_state_t *z80); INLINE void prefix##_87(z80_state_t *z80); \ - INLINE void prefix##_88(z80_state_t *z80); INLINE void prefix##_89(z80_state_t *z80); INLINE void prefix##_8a(z80_state_t *z80); INLINE void prefix##_8b(z80_state_t *z80); \ - INLINE void prefix##_8c(z80_state_t *z80); INLINE void prefix##_8d(z80_state_t *z80); INLINE void prefix##_8e(z80_state_t *z80); INLINE void prefix##_8f(z80_state_t *z80); \ - INLINE void prefix##_90(z80_state_t *z80); INLINE void prefix##_91(z80_state_t *z80); INLINE void prefix##_92(z80_state_t *z80); INLINE void prefix##_93(z80_state_t *z80); \ - INLINE void prefix##_94(z80_state_t *z80); INLINE void prefix##_95(z80_state_t *z80); INLINE void prefix##_96(z80_state_t *z80); INLINE void prefix##_97(z80_state_t *z80); \ - INLINE void prefix##_98(z80_state_t *z80); INLINE void prefix##_99(z80_state_t *z80); INLINE void prefix##_9a(z80_state_t *z80); INLINE void prefix##_9b(z80_state_t *z80); \ - INLINE void prefix##_9c(z80_state_t *z80); INLINE void prefix##_9d(z80_state_t *z80); INLINE void prefix##_9e(z80_state_t *z80); INLINE void prefix##_9f(z80_state_t *z80); \ - INLINE void prefix##_a0(z80_state_t *z80); INLINE void prefix##_a1(z80_state_t *z80); INLINE void prefix##_a2(z80_state_t *z80); INLINE void prefix##_a3(z80_state_t *z80); \ - INLINE void prefix##_a4(z80_state_t *z80); INLINE void prefix##_a5(z80_state_t *z80); INLINE void prefix##_a6(z80_state_t *z80); INLINE void prefix##_a7(z80_state_t *z80); \ - INLINE void prefix##_a8(z80_state_t *z80); INLINE void prefix##_a9(z80_state_t *z80); INLINE void prefix##_aa(z80_state_t *z80); INLINE void prefix##_ab(z80_state_t *z80); \ - INLINE void prefix##_ac(z80_state_t *z80); INLINE void prefix##_ad(z80_state_t *z80); INLINE void prefix##_ae(z80_state_t *z80); INLINE void prefix##_af(z80_state_t *z80); \ - INLINE void prefix##_b0(z80_state_t *z80); INLINE void prefix##_b1(z80_state_t *z80); INLINE void prefix##_b2(z80_state_t *z80); INLINE void prefix##_b3(z80_state_t *z80); \ - INLINE void prefix##_b4(z80_state_t *z80); INLINE void prefix##_b5(z80_state_t *z80); INLINE void prefix##_b6(z80_state_t *z80); INLINE void prefix##_b7(z80_state_t *z80); \ - INLINE void prefix##_b8(z80_state_t *z80); INLINE void prefix##_b9(z80_state_t *z80); INLINE void prefix##_ba(z80_state_t *z80); INLINE void prefix##_bb(z80_state_t *z80); \ - INLINE void prefix##_bc(z80_state_t *z80); INLINE void prefix##_bd(z80_state_t *z80); INLINE void prefix##_be(z80_state_t *z80); INLINE void prefix##_bf(z80_state_t *z80); \ - INLINE void prefix##_c0(z80_state_t *z80); INLINE void prefix##_c1(z80_state_t *z80); INLINE void prefix##_c2(z80_state_t *z80); INLINE void prefix##_c3(z80_state_t *z80); \ - INLINE void prefix##_c4(z80_state_t *z80); INLINE void prefix##_c5(z80_state_t *z80); INLINE void prefix##_c6(z80_state_t *z80); INLINE void prefix##_c7(z80_state_t *z80); \ - INLINE void prefix##_c8(z80_state_t *z80); INLINE void prefix##_c9(z80_state_t *z80); INLINE void prefix##_ca(z80_state_t *z80); INLINE void prefix##_cb(z80_state_t *z80); \ - INLINE void prefix##_cc(z80_state_t *z80); INLINE void prefix##_cd(z80_state_t *z80); INLINE void prefix##_ce(z80_state_t *z80); INLINE void prefix##_cf(z80_state_t *z80); \ - INLINE void prefix##_d0(z80_state_t *z80); INLINE void prefix##_d1(z80_state_t *z80); INLINE void prefix##_d2(z80_state_t *z80); INLINE void prefix##_d3(z80_state_t *z80); \ - INLINE void prefix##_d4(z80_state_t *z80); INLINE void prefix##_d5(z80_state_t *z80); INLINE void prefix##_d6(z80_state_t *z80); INLINE void prefix##_d7(z80_state_t *z80); \ - INLINE void prefix##_d8(z80_state_t *z80); INLINE void prefix##_d9(z80_state_t *z80); INLINE void prefix##_da(z80_state_t *z80); INLINE void prefix##_db(z80_state_t *z80); \ - INLINE void prefix##_dc(z80_state_t *z80); INLINE void prefix##_dd(z80_state_t *z80); INLINE void prefix##_de(z80_state_t *z80); INLINE void prefix##_df(z80_state_t *z80); \ - INLINE void prefix##_e0(z80_state_t *z80); INLINE void prefix##_e1(z80_state_t *z80); INLINE void prefix##_e2(z80_state_t *z80); INLINE void prefix##_e3(z80_state_t *z80); \ - INLINE void prefix##_e4(z80_state_t *z80); INLINE void prefix##_e5(z80_state_t *z80); INLINE void prefix##_e6(z80_state_t *z80); INLINE void prefix##_e7(z80_state_t *z80); \ - INLINE void prefix##_e8(z80_state_t *z80); INLINE void prefix##_e9(z80_state_t *z80); INLINE void prefix##_ea(z80_state_t *z80); INLINE void prefix##_eb(z80_state_t *z80); \ - INLINE void prefix##_ec(z80_state_t *z80); INLINE void prefix##_ed(z80_state_t *z80); INLINE void prefix##_ee(z80_state_t *z80); INLINE void prefix##_ef(z80_state_t *z80); \ - INLINE void prefix##_f0(z80_state_t *z80); INLINE void prefix##_f1(z80_state_t *z80); INLINE void prefix##_f2(z80_state_t *z80); INLINE void prefix##_f3(z80_state_t *z80); \ - INLINE void prefix##_f4(z80_state_t *z80); INLINE void prefix##_f5(z80_state_t *z80); INLINE void prefix##_f6(z80_state_t *z80); INLINE void prefix##_f7(z80_state_t *z80); \ - INLINE void prefix##_f8(z80_state_t *z80); INLINE void prefix##_f9(z80_state_t *z80); INLINE void prefix##_fa(z80_state_t *z80); INLINE void prefix##_fb(z80_state_t *z80); \ - INLINE void prefix##_fc(z80_state_t *z80); INLINE void prefix##_fd(z80_state_t *z80); INLINE void prefix##_fe(z80_state_t *z80); INLINE void prefix##_ff(z80_state_t *z80); \ + static INLINE void prefix##_00(z80_state_t *z80); static INLINE void prefix##_01(z80_state_t *z80); static INLINE void prefix##_02(z80_state_t *z80); static INLINE void prefix##_03(z80_state_t *z80); \ + static INLINE void prefix##_04(z80_state_t *z80); static INLINE void prefix##_05(z80_state_t *z80); static INLINE void prefix##_06(z80_state_t *z80); static INLINE void prefix##_07(z80_state_t *z80); \ + static INLINE void prefix##_08(z80_state_t *z80); static INLINE void prefix##_09(z80_state_t *z80); static INLINE void prefix##_0a(z80_state_t *z80); static INLINE void prefix##_0b(z80_state_t *z80); \ + static INLINE void prefix##_0c(z80_state_t *z80); static INLINE void prefix##_0d(z80_state_t *z80); static INLINE void prefix##_0e(z80_state_t *z80); static INLINE void prefix##_0f(z80_state_t *z80); \ + static INLINE void prefix##_10(z80_state_t *z80); static INLINE void prefix##_11(z80_state_t *z80); static INLINE void prefix##_12(z80_state_t *z80); static INLINE void prefix##_13(z80_state_t *z80); \ + static INLINE void prefix##_14(z80_state_t *z80); static INLINE void prefix##_15(z80_state_t *z80); static INLINE void prefix##_16(z80_state_t *z80); static INLINE void prefix##_17(z80_state_t *z80); \ + static INLINE void prefix##_18(z80_state_t *z80); static INLINE void prefix##_19(z80_state_t *z80); static INLINE void prefix##_1a(z80_state_t *z80); static INLINE void prefix##_1b(z80_state_t *z80); \ + static INLINE void prefix##_1c(z80_state_t *z80); static INLINE void prefix##_1d(z80_state_t *z80); static INLINE void prefix##_1e(z80_state_t *z80); static INLINE void prefix##_1f(z80_state_t *z80); \ + static INLINE void prefix##_20(z80_state_t *z80); static INLINE void prefix##_21(z80_state_t *z80); static INLINE void prefix##_22(z80_state_t *z80); static INLINE void prefix##_23(z80_state_t *z80); \ + static INLINE void prefix##_24(z80_state_t *z80); static INLINE void prefix##_25(z80_state_t *z80); static INLINE void prefix##_26(z80_state_t *z80); static INLINE void prefix##_27(z80_state_t *z80); \ + static INLINE void prefix##_28(z80_state_t *z80); static INLINE void prefix##_29(z80_state_t *z80); static INLINE void prefix##_2a(z80_state_t *z80); static INLINE void prefix##_2b(z80_state_t *z80); \ + static INLINE void prefix##_2c(z80_state_t *z80); static INLINE void prefix##_2d(z80_state_t *z80); static INLINE void prefix##_2e(z80_state_t *z80); static INLINE void prefix##_2f(z80_state_t *z80); \ + static INLINE void prefix##_30(z80_state_t *z80); static INLINE void prefix##_31(z80_state_t *z80); static INLINE void prefix##_32(z80_state_t *z80); static INLINE void prefix##_33(z80_state_t *z80); \ + static INLINE void prefix##_34(z80_state_t *z80); static INLINE void prefix##_35(z80_state_t *z80); static INLINE void prefix##_36(z80_state_t *z80); static INLINE void prefix##_37(z80_state_t *z80); \ + static INLINE void prefix##_38(z80_state_t *z80); static INLINE void prefix##_39(z80_state_t *z80); static INLINE void prefix##_3a(z80_state_t *z80); static INLINE void prefix##_3b(z80_state_t *z80); \ + static INLINE void prefix##_3c(z80_state_t *z80); static INLINE void prefix##_3d(z80_state_t *z80); static INLINE void prefix##_3e(z80_state_t *z80); static INLINE void prefix##_3f(z80_state_t *z80); \ + static INLINE void prefix##_40(z80_state_t *z80); static INLINE void prefix##_41(z80_state_t *z80); static INLINE void prefix##_42(z80_state_t *z80); static INLINE void prefix##_43(z80_state_t *z80); \ + static INLINE void prefix##_44(z80_state_t *z80); static INLINE void prefix##_45(z80_state_t *z80); static INLINE void prefix##_46(z80_state_t *z80); static INLINE void prefix##_47(z80_state_t *z80); \ + static INLINE void prefix##_48(z80_state_t *z80); static INLINE void prefix##_49(z80_state_t *z80); static INLINE void prefix##_4a(z80_state_t *z80); static INLINE void prefix##_4b(z80_state_t *z80); \ + static INLINE void prefix##_4c(z80_state_t *z80); static INLINE void prefix##_4d(z80_state_t *z80); static INLINE void prefix##_4e(z80_state_t *z80); static INLINE void prefix##_4f(z80_state_t *z80); \ + static INLINE void prefix##_50(z80_state_t *z80); static INLINE void prefix##_51(z80_state_t *z80); static INLINE void prefix##_52(z80_state_t *z80); static INLINE void prefix##_53(z80_state_t *z80); \ + static INLINE void prefix##_54(z80_state_t *z80); static INLINE void prefix##_55(z80_state_t *z80); static INLINE void prefix##_56(z80_state_t *z80); static INLINE void prefix##_57(z80_state_t *z80); \ + static INLINE void prefix##_58(z80_state_t *z80); static INLINE void prefix##_59(z80_state_t *z80); static INLINE void prefix##_5a(z80_state_t *z80); static INLINE void prefix##_5b(z80_state_t *z80); \ + static INLINE void prefix##_5c(z80_state_t *z80); static INLINE void prefix##_5d(z80_state_t *z80); static INLINE void prefix##_5e(z80_state_t *z80); static INLINE void prefix##_5f(z80_state_t *z80); \ + static INLINE void prefix##_60(z80_state_t *z80); static INLINE void prefix##_61(z80_state_t *z80); static INLINE void prefix##_62(z80_state_t *z80); static INLINE void prefix##_63(z80_state_t *z80); \ + static INLINE void prefix##_64(z80_state_t *z80); static INLINE void prefix##_65(z80_state_t *z80); static INLINE void prefix##_66(z80_state_t *z80); static INLINE void prefix##_67(z80_state_t *z80); \ + static INLINE void prefix##_68(z80_state_t *z80); static INLINE void prefix##_69(z80_state_t *z80); static INLINE void prefix##_6a(z80_state_t *z80); static INLINE void prefix##_6b(z80_state_t *z80); \ + static INLINE void prefix##_6c(z80_state_t *z80); static INLINE void prefix##_6d(z80_state_t *z80); static INLINE void prefix##_6e(z80_state_t *z80); static INLINE void prefix##_6f(z80_state_t *z80); \ + static INLINE void prefix##_70(z80_state_t *z80); static INLINE void prefix##_71(z80_state_t *z80); static INLINE void prefix##_72(z80_state_t *z80); static INLINE void prefix##_73(z80_state_t *z80); \ + static INLINE void prefix##_74(z80_state_t *z80); static INLINE void prefix##_75(z80_state_t *z80); static INLINE void prefix##_76(z80_state_t *z80); static INLINE void prefix##_77(z80_state_t *z80); \ + static INLINE void prefix##_78(z80_state_t *z80); static INLINE void prefix##_79(z80_state_t *z80); static INLINE void prefix##_7a(z80_state_t *z80); static INLINE void prefix##_7b(z80_state_t *z80); \ + static INLINE void prefix##_7c(z80_state_t *z80); static INLINE void prefix##_7d(z80_state_t *z80); static INLINE void prefix##_7e(z80_state_t *z80); static INLINE void prefix##_7f(z80_state_t *z80); \ + static INLINE void prefix##_80(z80_state_t *z80); static INLINE void prefix##_81(z80_state_t *z80); static INLINE void prefix##_82(z80_state_t *z80); static INLINE void prefix##_83(z80_state_t *z80); \ + static INLINE void prefix##_84(z80_state_t *z80); static INLINE void prefix##_85(z80_state_t *z80); static INLINE void prefix##_86(z80_state_t *z80); static INLINE void prefix##_87(z80_state_t *z80); \ + static INLINE void prefix##_88(z80_state_t *z80); static INLINE void prefix##_89(z80_state_t *z80); static INLINE void prefix##_8a(z80_state_t *z80); static INLINE void prefix##_8b(z80_state_t *z80); \ + static INLINE void prefix##_8c(z80_state_t *z80); static INLINE void prefix##_8d(z80_state_t *z80); static INLINE void prefix##_8e(z80_state_t *z80); static INLINE void prefix##_8f(z80_state_t *z80); \ + static INLINE void prefix##_90(z80_state_t *z80); static INLINE void prefix##_91(z80_state_t *z80); static INLINE void prefix##_92(z80_state_t *z80); static INLINE void prefix##_93(z80_state_t *z80); \ + static INLINE void prefix##_94(z80_state_t *z80); static INLINE void prefix##_95(z80_state_t *z80); static INLINE void prefix##_96(z80_state_t *z80); static INLINE void prefix##_97(z80_state_t *z80); \ + static INLINE void prefix##_98(z80_state_t *z80); static INLINE void prefix##_99(z80_state_t *z80); static INLINE void prefix##_9a(z80_state_t *z80); static INLINE void prefix##_9b(z80_state_t *z80); \ + static INLINE void prefix##_9c(z80_state_t *z80); static INLINE void prefix##_9d(z80_state_t *z80); static INLINE void prefix##_9e(z80_state_t *z80); static INLINE void prefix##_9f(z80_state_t *z80); \ + static INLINE void prefix##_a0(z80_state_t *z80); static INLINE void prefix##_a1(z80_state_t *z80); static INLINE void prefix##_a2(z80_state_t *z80); static INLINE void prefix##_a3(z80_state_t *z80); \ + static INLINE void prefix##_a4(z80_state_t *z80); static INLINE void prefix##_a5(z80_state_t *z80); static INLINE void prefix##_a6(z80_state_t *z80); static INLINE void prefix##_a7(z80_state_t *z80); \ + static INLINE void prefix##_a8(z80_state_t *z80); static INLINE void prefix##_a9(z80_state_t *z80); static INLINE void prefix##_aa(z80_state_t *z80); static INLINE void prefix##_ab(z80_state_t *z80); \ + static INLINE void prefix##_ac(z80_state_t *z80); static INLINE void prefix##_ad(z80_state_t *z80); static INLINE void prefix##_ae(z80_state_t *z80); static INLINE void prefix##_af(z80_state_t *z80); \ + static INLINE void prefix##_b0(z80_state_t *z80); static INLINE void prefix##_b1(z80_state_t *z80); static INLINE void prefix##_b2(z80_state_t *z80); static INLINE void prefix##_b3(z80_state_t *z80); \ + static INLINE void prefix##_b4(z80_state_t *z80); static INLINE void prefix##_b5(z80_state_t *z80); static INLINE void prefix##_b6(z80_state_t *z80); static INLINE void prefix##_b7(z80_state_t *z80); \ + static INLINE void prefix##_b8(z80_state_t *z80); static INLINE void prefix##_b9(z80_state_t *z80); static INLINE void prefix##_ba(z80_state_t *z80); static INLINE void prefix##_bb(z80_state_t *z80); \ + static INLINE void prefix##_bc(z80_state_t *z80); static INLINE void prefix##_bd(z80_state_t *z80); static INLINE void prefix##_be(z80_state_t *z80); static INLINE void prefix##_bf(z80_state_t *z80); \ + static INLINE void prefix##_c0(z80_state_t *z80); static INLINE void prefix##_c1(z80_state_t *z80); static INLINE void prefix##_c2(z80_state_t *z80); static INLINE void prefix##_c3(z80_state_t *z80); \ + static INLINE void prefix##_c4(z80_state_t *z80); static INLINE void prefix##_c5(z80_state_t *z80); static INLINE void prefix##_c6(z80_state_t *z80); static INLINE void prefix##_c7(z80_state_t *z80); \ + static INLINE void prefix##_c8(z80_state_t *z80); static INLINE void prefix##_c9(z80_state_t *z80); static INLINE void prefix##_ca(z80_state_t *z80); static INLINE void prefix##_cb(z80_state_t *z80); \ + static INLINE void prefix##_cc(z80_state_t *z80); static INLINE void prefix##_cd(z80_state_t *z80); static INLINE void prefix##_ce(z80_state_t *z80); static INLINE void prefix##_cf(z80_state_t *z80); \ + static INLINE void prefix##_d0(z80_state_t *z80); static INLINE void prefix##_d1(z80_state_t *z80); static INLINE void prefix##_d2(z80_state_t *z80); static INLINE void prefix##_d3(z80_state_t *z80); \ + static INLINE void prefix##_d4(z80_state_t *z80); static INLINE void prefix##_d5(z80_state_t *z80); static INLINE void prefix##_d6(z80_state_t *z80); static INLINE void prefix##_d7(z80_state_t *z80); \ + static INLINE void prefix##_d8(z80_state_t *z80); static INLINE void prefix##_d9(z80_state_t *z80); static INLINE void prefix##_da(z80_state_t *z80); static INLINE void prefix##_db(z80_state_t *z80); \ + static INLINE void prefix##_dc(z80_state_t *z80); static INLINE void prefix##_dd(z80_state_t *z80); static INLINE void prefix##_de(z80_state_t *z80); static INLINE void prefix##_df(z80_state_t *z80); \ + static INLINE void prefix##_e0(z80_state_t *z80); static INLINE void prefix##_e1(z80_state_t *z80); static INLINE void prefix##_e2(z80_state_t *z80); static INLINE void prefix##_e3(z80_state_t *z80); \ + static INLINE void prefix##_e4(z80_state_t *z80); static INLINE void prefix##_e5(z80_state_t *z80); static INLINE void prefix##_e6(z80_state_t *z80); static INLINE void prefix##_e7(z80_state_t *z80); \ + static INLINE void prefix##_e8(z80_state_t *z80); static INLINE void prefix##_e9(z80_state_t *z80); static INLINE void prefix##_ea(z80_state_t *z80); static INLINE void prefix##_eb(z80_state_t *z80); \ + static INLINE void prefix##_ec(z80_state_t *z80); static INLINE void prefix##_ed(z80_state_t *z80); static INLINE void prefix##_ee(z80_state_t *z80); static INLINE void prefix##_ef(z80_state_t *z80); \ + static INLINE void prefix##_f0(z80_state_t *z80); static INLINE void prefix##_f1(z80_state_t *z80); static INLINE void prefix##_f2(z80_state_t *z80); static INLINE void prefix##_f3(z80_state_t *z80); \ + static INLINE void prefix##_f4(z80_state_t *z80); static INLINE void prefix##_f5(z80_state_t *z80); static INLINE void prefix##_f6(z80_state_t *z80); static INLINE void prefix##_f7(z80_state_t *z80); \ + static INLINE void prefix##_f8(z80_state_t *z80); static INLINE void prefix##_f9(z80_state_t *z80); static INLINE void prefix##_fa(z80_state_t *z80); static INLINE void prefix##_fb(z80_state_t *z80); \ + static INLINE void prefix##_fc(z80_state_t *z80); static INLINE void prefix##_fd(z80_state_t *z80); static INLINE void prefix##_fe(z80_state_t *z80); static INLINE void prefix##_ff(z80_state_t *z80); \ static const funcptr tablename[0x100] = { \ prefix##_00,prefix##_01,prefix##_02,prefix##_03,prefix##_04,prefix##_05,prefix##_06,prefix##_07, \ prefix##_08,prefix##_09,prefix##_0a,prefix##_0b,prefix##_0c,prefix##_0d,prefix##_0e,prefix##_0f, \ @@ -387,7 +387,7 @@ PROTOTYPES(Z80xycb,xycb); /* Burn an odd amount of cycles, that is instructions taking something */ /* different from 4 T-states per opcode (and R increment) */ /****************************************************************************/ -INLINE void BURNODD(z80_state_t *z80, int cycles, int opcodes, int cyclesum) +static INLINE void BURNODD(z80_state_t *z80, int cycles, int opcodes, int cyclesum) { if( cycles > 0 ) { @@ -399,7 +399,7 @@ INLINE void BURNODD(z80_state_t *z80, int cycles, int opcodes, int cyclesum) /*************************************************************** * define an opcode function ***************************************************************/ -#define OP(prefix,opcode) INLINE void prefix##_##opcode(z80_state_t *z80) +#define OP(prefix,opcode) static INLINE void prefix##_##opcode(z80_state_t *z80) /*************************************************************** * adjust cycle count by n T-states @@ -533,7 +533,7 @@ INLINE void BURNODD(z80_state_t *z80, int cycles, int opcodes, int cyclesum) /*************************************************************** * Read a word from given memory location ***************************************************************/ -INLINE void RM16( z80_state_t *z80, UINT32 addr, PAIR *r ) +static INLINE void RM16( z80_state_t *z80, UINT32 addr, PAIR *r ) { r->b.l = RM(addr); r->b.h = RM((addr+1)&0xffff); @@ -547,7 +547,7 @@ INLINE void RM16( z80_state_t *z80, UINT32 addr, PAIR *r ) /*************************************************************** * Write a word to given memory location ***************************************************************/ -INLINE void WM16( z80_state_t *z80, UINT32 addr, PAIR *r ) +static INLINE void WM16( z80_state_t *z80, UINT32 addr, PAIR *r ) { WM(addr,r->b.l); WM((addr+1)&0xffff,r->b.h); @@ -558,7 +558,7 @@ INLINE void WM16( z80_state_t *z80, UINT32 addr, PAIR *r ) * reading opcodes. In case of system with memory mapped I/O, * this function can be used to greatly speed up emulation ***************************************************************/ -INLINE UINT8 ROP(z80_state_t *z80) +static INLINE UINT8 ROP(z80_state_t *z80) { unsigned pc = _PCD; _PC++; @@ -571,14 +571,14 @@ INLINE UINT8 ROP(z80_state_t *z80) * support systems that use different encoding mechanisms for * opcodes and opcode arguments ***************************************************************/ -INLINE UINT8 ARG(z80_state_t *z80) +static INLINE UINT8 ARG(z80_state_t *z80) { unsigned pc = _PCD; _PC++; return cpu_readop_arg(z80->userdata, pc); } -INLINE UINT32 ARG16(z80_state_t *z80) +static INLINE UINT32 ARG16(z80_state_t *z80) { unsigned pc = _PCD; _PC += 2; @@ -825,7 +825,7 @@ INLINE UINT32 ARG16(z80_state_t *z80) /*************************************************************** * INC r8 ***************************************************************/ -INLINE UINT8 INC(z80_state_t *z80, UINT8 value) +static INLINE UINT8 INC(z80_state_t *z80, UINT8 value) { UINT8 res = value + 1; _F = (_F & CF) | z80->SZHV_inc[res]; @@ -835,7 +835,7 @@ INLINE UINT8 INC(z80_state_t *z80, UINT8 value) /*************************************************************** * DEC r8 ***************************************************************/ -INLINE UINT8 DEC(z80_state_t *z80, UINT8 value) +static INLINE UINT8 DEC(z80_state_t *z80, UINT8 value) { UINT8 res = value - 1; _F = (_F & CF) | z80->SZHV_dec[res]; @@ -1493,7 +1493,7 @@ asm ( \ /*************************************************************** * RLC r8 ***************************************************************/ -INLINE UINT8 RLC(z80_state_t *z80, UINT8 value) +static INLINE UINT8 RLC(z80_state_t *z80, UINT8 value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -1505,7 +1505,7 @@ INLINE UINT8 RLC(z80_state_t *z80, UINT8 value) /*************************************************************** * RRC r8 ***************************************************************/ -INLINE UINT8 RRC(z80_state_t *z80, UINT8 value) +static INLINE UINT8 RRC(z80_state_t *z80, UINT8 value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -1517,7 +1517,7 @@ INLINE UINT8 RRC(z80_state_t *z80, UINT8 value) /*************************************************************** * RL r8 ***************************************************************/ -INLINE UINT8 RL(z80_state_t *z80, UINT8 value) +static INLINE UINT8 RL(z80_state_t *z80, UINT8 value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -1529,7 +1529,7 @@ INLINE UINT8 RL(z80_state_t *z80, UINT8 value) /*************************************************************** * RR r8 ***************************************************************/ -INLINE UINT8 RR(z80_state_t *z80, UINT8 value) +static INLINE UINT8 RR(z80_state_t *z80, UINT8 value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -1541,7 +1541,7 @@ INLINE UINT8 RR(z80_state_t *z80, UINT8 value) /*************************************************************** * SLA r8 ***************************************************************/ -INLINE UINT8 SLA(z80_state_t *z80, UINT8 value) +static INLINE UINT8 SLA(z80_state_t *z80, UINT8 value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -1553,7 +1553,7 @@ INLINE UINT8 SLA(z80_state_t *z80, UINT8 value) /*************************************************************** * SRA r8 ***************************************************************/ -INLINE UINT8 SRA(z80_state_t *z80, UINT8 value) +static INLINE UINT8 SRA(z80_state_t *z80, UINT8 value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -1565,7 +1565,7 @@ INLINE UINT8 SRA(z80_state_t *z80, UINT8 value) /*************************************************************** * SLL r8 ***************************************************************/ -INLINE UINT8 SLL(z80_state_t *z80, UINT8 value) +static INLINE UINT8 SLL(z80_state_t *z80, UINT8 value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -1577,7 +1577,7 @@ INLINE UINT8 SLL(z80_state_t *z80, UINT8 value) /*************************************************************** * SRL r8 ***************************************************************/ -INLINE UINT8 SRL(z80_state_t *z80, UINT8 value) +static INLINE UINT8 SRL(z80_state_t *z80, UINT8 value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -1606,7 +1606,7 @@ INLINE UINT8 SRL(z80_state_t *z80, UINT8 value) /*************************************************************** * RES bit,r8 ***************************************************************/ -INLINE UINT8 RES(z80_state_t *z80, UINT8 bit, UINT8 value) +static INLINE UINT8 RES(z80_state_t *z80, UINT8 bit, UINT8 value) { return value & ~(1< Date: Wed, 25 Jun 2014 20:47:02 +0200 Subject: artwork: fix regression in fetching album art from id3v2.4 --- plugins/artwork/artwork.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'plugins') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 612e4f1e..7a5b56f6 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1002,10 +1002,6 @@ fetcher_thread (void *none) continue; } uint8_t *data = f->data; - if (tag.version[0] == 4) { - // skip size - data += 4; - } uint8_t *end = f->data + f->size; int enc = *data; data++; // enc -- cgit v1.2.3 From 14076372670c6a8141b02ae84531468383dbf876 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Wed, 25 Jun 2014 21:08:32 +0200 Subject: oss: deleted bogus oss_free call from oss_pause --- plugins/oss/oss.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'plugins') diff --git a/plugins/oss/oss.c b/plugins/oss/oss.c index 538b4807..74707a78 100644 --- a/plugins/oss/oss.c +++ b/plugins/oss/oss.c @@ -195,8 +195,6 @@ oss_pause (void) { if (state == OUTPUT_STATE_STOPPED) { return -1; } - // set pause state - oss_free(); state = OUTPUT_STATE_PAUSED; return 0; } -- cgit v1.2.3 From b1e35de2da7b40d1df3c45df447aa811af438f2c Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Wed, 25 Jun 2014 22:03:07 +0200 Subject: ao: added static to INLINE SCSP_UpdateSlot in plugins/ao/eng_ssf/scsp.c --- plugins/ao/eng_ssf/scsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/ao/eng_ssf/scsp.c b/plugins/ao/eng_ssf/scsp.c index f3a3d9da..0afff77e 100644 --- a/plugins/ao/eng_ssf/scsp.c +++ b/plugins/ao/eng_ssf/scsp.c @@ -858,7 +858,7 @@ void SCSP_TimersAddTicks(struct _SCSP *SCSP, int ticks) } } -INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot) +static INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot) { INT32 sample; int step=slot->step; -- cgit v1.2.3 From 7761b4f244dcbbe60ce4b5bc7ea5f687cf45be39 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Wed, 25 Jun 2014 22:38:34 +0200 Subject: ao: made MixREVERBLeft static --- plugins/ao/eng_psf/peops2/reverb2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/ao/eng_psf/peops2/reverb2.c b/plugins/ao/eng_psf/peops2/reverb2.c index ceab8c54..e939be87 100644 --- a/plugins/ao/eng_psf/peops2/reverb2.c +++ b/plugins/ao/eng_psf/peops2/reverb2.c @@ -134,7 +134,7 @@ INLINE void s_buffer1(spu2_state_t *spu, int iOff,int iVal,int core) // set //////////////////////////////////////////////////////////////////////// -INLINE int MixREVERBLeft(spu2_state_t *spu, int ns,int core) +static INLINE int MixREVERBLeft(spu2_state_t *spu, int ns,int core) { if(spu->iUseReverb==1) { -- cgit v1.2.3 From 3031fb0b877495e98233b2728cbb4a2bf5dbbe11 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Thu, 26 Jun 2014 23:41:33 +0400 Subject: ao: fixed BSD linking issues --- plugins/ao/eng_dsf/aica.c | 4 ++-- plugins/ao/eng_dsf/aicalfo.c | 4 ++-- plugins/ao/eng_psf/peops2/adsr.h | 4 ++-- plugins/ao/eng_psf/peops2/adsr2.c | 4 ++-- plugins/ao/eng_psf/peops2/reverb2.c | 14 +++++++------- plugins/ao/eng_psf/peops2/spu2.c | 6 +++--- plugins/ao/eng_psf/psx.c | 22 +++++++++++----------- plugins/ao/eng_ssf/scsplfo.c | 4 ++-- 8 files changed, 31 insertions(+), 31 deletions(-) (limited to 'plugins') diff --git a/plugins/ao/eng_dsf/aica.c b/plugins/ao/eng_dsf/aica.c index f504d647..02831699 100644 --- a/plugins/ao/eng_dsf/aica.c +++ b/plugins/ao/eng_dsf/aica.c @@ -402,7 +402,7 @@ void InitADPCM(int *PrevSignal, int *PrevQuant) *PrevQuant=0x7f; } -INLINE signed short DecodeADPCM(int *PrevSignal, unsigned char Delta, int *PrevQuant) +static INLINE signed short DecodeADPCM(int *PrevSignal, unsigned char Delta, int *PrevQuant) { int x = *PrevQuant * quant_mul [Delta & 15]; x = *PrevSignal + ((int)(x + ((UINT32)x >> 29)) >> 3); @@ -957,7 +957,7 @@ void AICA_TimersAddTicks(struct _AICA *AICA, int ticks) } } -INLINE INT32 AICA_UpdateSlot(struct _AICA *AICA, struct _SLOT *slot) +static INLINE INT32 AICA_UpdateSlot(struct _AICA *AICA, struct _SLOT *slot) { INT32 sample, fpart; int cur_sample; //current sample diff --git a/plugins/ao/eng_dsf/aicalfo.c b/plugins/ao/eng_dsf/aicalfo.c index 9af2ae54..cc1ea1cc 100644 --- a/plugins/ao/eng_dsf/aicalfo.c +++ b/plugins/ao/eng_dsf/aicalfo.c @@ -103,7 +103,7 @@ void AICALFO_Init(void) } } -signed int INLINE AICAPLFO_Step(struct _LFO *LFO) +static signed int INLINE AICAPLFO_Step(struct _LFO *LFO) { int p; @@ -116,7 +116,7 @@ signed int INLINE AICAPLFO_Step(struct _LFO *LFO) return p<<(SHIFT-LFO_SHIFT); } -signed int INLINE AICAALFO_Step(struct _LFO *LFO) +static signed int INLINE AICAALFO_Step(struct _LFO *LFO) { int p; LFO->phase+=LFO->phase_step; diff --git a/plugins/ao/eng_psf/peops2/adsr.h b/plugins/ao/eng_psf/peops2/adsr.h index 777a0d84..fc031ef0 100644 --- a/plugins/ao/eng_psf/peops2/adsr.h +++ b/plugins/ao/eng_psf/peops2/adsr.h @@ -24,5 +24,5 @@ // //*************************************************************************// -INLINE void StartADSR(int ch); -INLINE int MixADSR(int ch); +static INLINE void StartADSR(int ch); +static INLINE int MixADSR(int ch); diff --git a/plugins/ao/eng_psf/peops2/adsr2.c b/plugins/ao/eng_psf/peops2/adsr2.c index 470069c6..79af6c03 100644 --- a/plugins/ao/eng_psf/peops2/adsr2.c +++ b/plugins/ao/eng_psf/peops2/adsr2.c @@ -66,7 +66,7 @@ void InitADSR(void) // INIT ADSR //////////////////////////////////////////////////////////////////////// -INLINE void StartADSR(spu2_state_t *spu, int ch) // MIX ADSR +static INLINE void StartADSR(spu2_state_t *spu, int ch) // MIX ADSR { spu->s_chan[ch].ADSRX.lVolume=1; // and init some adsr vars spu->s_chan[ch].ADSRX.State=0; @@ -75,7 +75,7 @@ INLINE void StartADSR(spu2_state_t *spu, int ch) // MIX //////////////////////////////////////////////////////////////////////// -INLINE int MixADSR(spu2_state_t *spu, int ch) // MIX ADSR +static INLINE int MixADSR(spu2_state_t *spu, int ch) // MIX ADSR { if(spu->s_chan[ch].bStop) // should be stopped: { // do release diff --git a/plugins/ao/eng_psf/peops2/reverb2.c b/plugins/ao/eng_psf/peops2/reverb2.c index e939be87..f8a80661 100644 --- a/plugins/ao/eng_psf/peops2/reverb2.c +++ b/plugins/ao/eng_psf/peops2/reverb2.c @@ -51,7 +51,7 @@ // START REVERB //////////////////////////////////////////////////////////////////////// -INLINE void StartREVERB(spu2_state_t *spu, int ch) +static INLINE void StartREVERB(spu2_state_t *spu, int ch) { int core=ch/24; @@ -66,7 +66,7 @@ INLINE void StartREVERB(spu2_state_t *spu, int ch) // HELPER FOR NEILL'S REVERB: re-inits our reverb mixing buf //////////////////////////////////////////////////////////////////////// -INLINE void InitREVERB(spu2_state_t *spu) +static INLINE void InitREVERB(spu2_state_t *spu) { if(spu->iUseReverb==1) { @@ -79,7 +79,7 @@ INLINE void InitREVERB(spu2_state_t *spu) // STORE REVERB //////////////////////////////////////////////////////////////////////// -INLINE void StoreREVERB(spu2_state_t *spu, int ch,int ns) +static INLINE void StoreREVERB(spu2_state_t *spu, int ch,int ns) { int core=ch/24; @@ -99,7 +99,7 @@ INLINE void StoreREVERB(spu2_state_t *spu, int ch,int ns) //////////////////////////////////////////////////////////////////////// -INLINE int g_buffer(spu2_state_t *spu, int iOff,int core) // get_buffer content helper: takes care about wraps +static INLINE int g_buffer(spu2_state_t *spu, int iOff,int core) // get_buffer content helper: takes care about wraps { short * p=(short *)spu->spuMem; iOff=(iOff)+spu->rvb[core].CurrAddr; @@ -110,7 +110,7 @@ INLINE int g_buffer(spu2_state_t *spu, int iOff,int core) // g //////////////////////////////////////////////////////////////////////// -INLINE void s_buffer(spu2_state_t *spu, int iOff,int iVal,int core) // set_buffer content helper: takes care about wraps and clipping +static INLINE void s_buffer(spu2_state_t *spu, int iOff,int iVal,int core) // set_buffer content helper: takes care about wraps and clipping { short * p=(short *)spu->spuMem; iOff=(iOff)+spu->rvb[core].CurrAddr; @@ -122,7 +122,7 @@ INLINE void s_buffer(spu2_state_t *spu, int iOff,int iVal,int core) // se //////////////////////////////////////////////////////////////////////// -INLINE void s_buffer1(spu2_state_t *spu, int iOff,int iVal,int core) // set_buffer (+1 sample) content helper: takes care about wraps and clipping +static INLINE void s_buffer1(spu2_state_t *spu, int iOff,int iVal,int core) // set_buffer (+1 sample) content helper: takes care about wraps and clipping { short * p=(short *)spu->spuMem; iOff=(iOff)+spu->rvb[core].CurrAddr+1; @@ -221,7 +221,7 @@ static INLINE int MixREVERBLeft(spu2_state_t *spu, int ns,int core) //////////////////////////////////////////////////////////////////////// -INLINE int MixREVERBRight(spu2_state_t *spu, int core) +static INLINE int MixREVERBRight(spu2_state_t *spu, int core) { if(spu->iUseReverb==1) // Neill's reverb: { diff --git a/plugins/ao/eng_psf/peops2/spu2.c b/plugins/ao/eng_psf/peops2/spu2.c index 44546170..32f56ff0 100644 --- a/plugins/ao/eng_psf/peops2/spu2.c +++ b/plugins/ao/eng_psf/peops2/spu2.c @@ -170,7 +170,7 @@ const int f[5][2] = { { 0, 0 }, // -INLINE void InterpolateUp(spu2_state_t *spu, int ch) +static INLINE void InterpolateUp(spu2_state_t *spu, int ch) { if(spu->s_chan[ch].SB[32]==1) // flag == 1? calc step and set flag... and don't change the value in this pass { @@ -218,7 +218,7 @@ INLINE void InterpolateUp(spu2_state_t *spu, int ch) // even easier interpolation on downsampling, also no special filter, again just "Pete's common sense" tm // -INLINE void InterpolateDown(spu2_state_t *spu, int ch) +static INLINE void InterpolateDown(spu2_state_t *spu, int ch) { if(spu->s_chan[ch].sinc>=0x20000L) // we would skip at least one val? { @@ -244,7 +244,7 @@ INLINE void InterpolateDown(spu2_state_t *spu, int ch) // START SOUND... called by main thread to setup a new sound on a channel //////////////////////////////////////////////////////////////////////// -INLINE void StartSound(spu2_state_t *spu, int ch) +static INLINE void StartSound(spu2_state_t *spu, int ch) { spu->dwNewChannel2[ch/24]&=~(1<<(ch%24)); // clear new channel bit spu->dwEndChannel2[ch/24]&=~(1<<(ch%24)); // clear end channel bit diff --git a/plugins/ao/eng_psf/psx.c b/plugins/ao/eng_psf/psx.c index 8f646d05..1a0adda1 100644 --- a/plugins/ao/eng_psf/psx.c +++ b/plugins/ao/eng_psf/psx.c @@ -204,7 +204,7 @@ void GTELOG(const char *a,...) logerror( "%08x: GTE: %08x %s\n", cpu->pc, INS_COFUN( cpu->op ), s_text ); } #else -INLINE void GTELOG(const char *a, ...) {} +static INLINE void GTELOG(const char *a, ...) {} #endif static UINT32 getcp2dr( mips_cpu_context *cpu, int n_reg ); @@ -223,7 +223,7 @@ void mips_stop( void ) #endif } -INLINE void mips_set_cp0r(mips_cpu_context *cpu, int reg, UINT32 value ) +static INLINE void mips_set_cp0r(mips_cpu_context *cpu, int reg, UINT32 value ) { cpu->cp0r[ reg ] = value; if( reg == CP0_SR || reg == CP0_CAUSE ) @@ -240,7 +240,7 @@ INLINE void mips_set_cp0r(mips_cpu_context *cpu, int reg, UINT32 value ) } } -INLINE void mips_commit_delayed_load(mips_cpu_context *cpu) +static INLINE void mips_commit_delayed_load(mips_cpu_context *cpu) { if( cpu->delayr != 0 ) { @@ -250,7 +250,7 @@ INLINE void mips_commit_delayed_load(mips_cpu_context *cpu) } } -INLINE void mips_delayed_branch(mips_cpu_context *cpu, UINT32 n_adr ) +static INLINE void mips_delayed_branch(mips_cpu_context *cpu, UINT32 n_adr ) { if( ( n_adr & ( ( ( cpu->cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 3 ) ) != 0 ) { @@ -266,7 +266,7 @@ INLINE void mips_delayed_branch(mips_cpu_context *cpu, UINT32 n_adr ) } } -INLINE void mips_set_pc(mips_cpu_context *cpu, unsigned val ) +static INLINE void mips_set_pc(mips_cpu_context *cpu, unsigned val ) { cpu->pc = val; change_pc( val ); @@ -274,7 +274,7 @@ INLINE void mips_set_pc(mips_cpu_context *cpu, unsigned val ) cpu->delayv = 0; } -INLINE void mips_advance_pc(mips_cpu_context *cpu) +static INLINE void mips_advance_pc(mips_cpu_context *cpu) { if( cpu->delayr == REGPC ) { @@ -287,7 +287,7 @@ INLINE void mips_advance_pc(mips_cpu_context *cpu) } } -INLINE void mips_load(mips_cpu_context *cpu, UINT32 n_r, UINT32 n_v ) +static INLINE void mips_load(mips_cpu_context *cpu, UINT32 n_r, UINT32 n_v ) { mips_advance_pc(cpu); if( n_r != 0 ) @@ -296,7 +296,7 @@ INLINE void mips_load(mips_cpu_context *cpu, UINT32 n_r, UINT32 n_v ) } } -INLINE void mips_delayed_load( mips_cpu_context *cpu, UINT32 n_r, UINT32 n_v ) +static INLINE void mips_delayed_load( mips_cpu_context *cpu, UINT32 n_r, UINT32 n_v ) { if( cpu->delayr == REGPC ) { @@ -1905,7 +1905,7 @@ static void setcp2cr(mips_cpu_context *cpu, int n_reg, UINT32 n_value ) cpu->cp2cr[ n_reg ].d = n_value; } -INLINE INT32 LIM( mips_cpu_context *cpu, INT32 n_value, INT32 n_max, INT32 n_min, UINT32 n_flag ) +static INLINE INT32 LIM( mips_cpu_context *cpu, INT32 n_value, INT32 n_max, INT32 n_min, UINT32 n_flag ) { if( n_value > n_max ) { @@ -1920,7 +1920,7 @@ INLINE INT32 LIM( mips_cpu_context *cpu, INT32 n_value, INT32 n_max, INT32 n_min return n_value; } -INLINE INT64 BOUNDS( mips_cpu_context *cpu, INT64 n_value, INT64 n_max, int n_maxflag, INT64 n_min, int n_minflag ) +static INLINE INT64 BOUNDS( mips_cpu_context *cpu, INT64 n_value, INT64 n_max, int n_maxflag, INT64 n_min, int n_minflag ) { if( n_value > n_max ) { @@ -1944,7 +1944,7 @@ INLINE INT64 BOUNDS( mips_cpu_context *cpu, INT64 n_value, INT64 n_max, int n_ma #define Lm_C3( a ) LIM( cpu, ( a ), 0x00ff, 0x0000, ( 1 << 19 ) ) #define Lm_D( a ) LIM( cpu, ( a ), 0xffff, 0x0000, ( 1 << 31 ) | ( 1 << 18 ) ) -INLINE UINT32 Lm_E( mips_cpu_context *cpu, UINT32 n_z ) +static INLINE UINT32 Lm_E( mips_cpu_context *cpu, UINT32 n_z ) { if( n_z <= H / 2 ) { diff --git a/plugins/ao/eng_ssf/scsplfo.c b/plugins/ao/eng_ssf/scsplfo.c index c25e3c8d..0a8281c1 100644 --- a/plugins/ao/eng_ssf/scsplfo.c +++ b/plugins/ao/eng_ssf/scsplfo.c @@ -104,7 +104,7 @@ void LFO_Init(void) } } -signed int INLINE PLFO_Step(struct _LFO *LFO) +static signed int INLINE PLFO_Step(struct _LFO *LFO) { int p; LFO->phase+=LFO->phase_step; @@ -116,7 +116,7 @@ signed int INLINE PLFO_Step(struct _LFO *LFO) return p<<(SHIFT-LFO_SHIFT); } -signed int INLINE ALFO_Step(struct _LFO *LFO) +static signed int INLINE ALFO_Step(struct _LFO *LFO) { int p; LFO->phase+=LFO->phase_step; -- cgit v1.2.3 From 5351e2f52bc77bb1b94e98af6b0dc829606ee0a3 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Fri, 27 Jun 2014 00:21:35 +0400 Subject: oss: always reopen sound device before changing output format --- plugins/oss/oss.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'plugins') diff --git a/plugins/oss/oss.c b/plugins/oss/oss.c index 74707a78..458b8a9f 100644 --- a/plugins/oss/oss.c +++ b/plugins/oss/oss.c @@ -73,7 +73,7 @@ oss_set_hwparams (ddb_waveformat_t *fmt) { break; } if (ioctl (fd, SNDCTL_DSP_SETFMT, &samplefmt) == -1) { - fprintf (stderr, "oss: failed to set format\n"); + fprintf (stderr, "oss: failed to set format (return: %d)\n", samplefmt); perror ("SNDCTL_DSP_SETFMT"); return -1; } @@ -211,18 +211,15 @@ oss_setformat (ddb_waveformat_t *fmt) { } int _state = state; - int v4workaround = deadbeef->conf_get_int ("oss.v4workaround", 0); deadbeef->mutex_lock (mutex); - if (v4workaround) { - if (fd) { - close (fd); - fd = 0; - } - fd = open (oss_device, O_WRONLY); - memcpy (&plugin.fmt, fmt, sizeof (ddb_waveformat_t)); + if (fd) { + close (fd); + fd = 0; } + fd = open (oss_device, O_WRONLY); + memcpy (&plugin.fmt, fmt, sizeof (ddb_waveformat_t)); if (0 != oss_set_hwparams (fmt)) { deadbeef->mutex_unlock (mutex); return -1; @@ -367,8 +364,7 @@ oss_load (DB_functions_t *api) { } static const char settings_dlg[] = - "property \"Device file\" entry oss.device /dev/dsp;\n" - "property \"OSS4 samplerate bug workaround\" checkbox oss.v4workaround 0;\n"; + "property \"Device file\" entry oss.device /dev/dsp;\n"; // define plugin interface static DB_output_t plugin = { -- cgit v1.2.3 From 2fa55c37ea2c33be975ed5500912af429a113144 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Fri, 27 Jun 2014 19:25:51 +0200 Subject: Revert "artwork: fix regression in fetching album art from id3v2.4" This reverts commit dea04451c8aaf322e397aceca0f871f9ff6ee5e2. --- plugins/artwork/artwork.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 7a5b56f6..612e4f1e 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1002,6 +1002,10 @@ fetcher_thread (void *none) continue; } uint8_t *data = f->data; + if (tag.version[0] == 4) { + // skip size + data += 4; + } uint8_t *end = f->data + f->size; int enc = *data; data++; // enc -- cgit v1.2.3 From 5267c9b2c585417566a4e28da23e81548000d2d7 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Fri, 27 Jun 2014 19:47:39 +0200 Subject: artwork: new id3v2 APIC handling fix --- plugins/artwork/artwork.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 612e4f1e..41963292 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1002,8 +1002,7 @@ fetcher_thread (void *none) continue; } uint8_t *data = f->data; - if (tag.version[0] == 4) { - // skip size + if (f->flags[1] == 3) { data += 4; } uint8_t *end = f->data + f->size; -- cgit v1.2.3 From 8910345b6e0f5818ad5c093bf36a62b829f5a6d5 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Fri, 27 Jun 2014 20:32:42 +0200 Subject: artwork: proper support for data length indicator when parsing APIC --- plugins/artwork/artwork.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 41963292..64a1a11c 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -70,8 +70,8 @@ static uintptr_t imlib_mutex; #define min(x,y) ((x)<(y)?(x):(y)) -//#define trace(...) { fprintf(stderr, __VA_ARGS__); } -#define trace(...) +#define trace(...) { fprintf(stderr, __VA_ARGS__); } +//#define trace(...) static char default_cover[PATH_MAX]; #define DEFAULT_FILEMASK "*cover*.jpg;*front*.jpg;*folder*.jpg;*cover*.png;*front*.png;*folder*.png" @@ -1001,10 +1001,23 @@ fetcher_thread (void *none) trace ("artwork: id3v2 APIC frame is too small\n"); continue; } + uint8_t *data = f->data; - if (f->flags[1] == 3) { + + if (tag.version[0] == 4 && (f->flags[1] & 1)) { data += 4; } +#if 0 + printf ("version: %d, flags: %d %d\n", (int)tag.version[0], (int)f->flags[0], (int)f->flags[1]); + for (int i = 0; i < 20; i++) { + printf ("%c", data[i] < 0x20 ? '?' : data[i]); + } + printf ("\n"); + for (int i = 0; i < 20; i++) { + printf ("%02x ", data[i]); + } + printf ("\n"); +#endif uint8_t *end = f->data + f->size; int enc = *data; data++; // enc -- cgit v1.2.3 From 0e25f2b3d4b2ce21a587703a08043d2b98a31d4d Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Fri, 27 Jun 2014 20:46:56 +0200 Subject: shellexecui: disallow multiple shellexecui dialogs --- plugins/shellexecui/callbacks.c | 1 - plugins/shellexecui/callbacks.h | 4 ++++ plugins/shellexecui/interface.c | 4 ++++ plugins/shellexecui/shellexec.glade | 3 ++- plugins/shellexecui/shellexecui.c | 11 +++++++++++ 5 files changed, 21 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/shellexecui/callbacks.c b/plugins/shellexecui/callbacks.c index b8fb56d3..019fde92 100644 --- a/plugins/shellexecui/callbacks.c +++ b/plugins/shellexecui/callbacks.c @@ -8,4 +8,3 @@ #include "interface.h" #include "support.h" - diff --git a/plugins/shellexecui/callbacks.h b/plugins/shellexecui/callbacks.h index c4b57687..4b1f2037 100644 --- a/plugins/shellexecui/callbacks.h +++ b/plugins/shellexecui/callbacks.h @@ -28,3 +28,7 @@ on_edit_cancel_button_clicked (GtkButton *button, void on_edit_ok_button_clicked (GtkButton *button, gpointer user_data); + +void +on_shellexec_conf_dialog_destroy (GObject *object, + gpointer user_data); diff --git a/plugins/shellexecui/interface.c b/plugins/shellexecui/interface.c index d00c0fc7..6296617b 100644 --- a/plugins/shellexecui/interface.c +++ b/plugins/shellexecui/interface.c @@ -44,6 +44,7 @@ create_shellexec_conf_dialog (void) shellexec_conf_dialog = gtk_dialog_new (); gtk_container_set_border_width (GTK_CONTAINER (shellexec_conf_dialog), 12); gtk_window_set_title (GTK_WINDOW (shellexec_conf_dialog), _("Custom Shell Commands")); + gtk_window_set_destroy_with_parent (GTK_WINDOW (shellexec_conf_dialog), TRUE); gtk_window_set_type_hint (GTK_WINDOW (shellexec_conf_dialog), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_dialog_set_has_separator (GTK_DIALOG (shellexec_conf_dialog), FALSE); @@ -89,6 +90,9 @@ create_shellexec_conf_dialog (void) gtk_dialog_add_action_widget (GTK_DIALOG (shellexec_conf_dialog), save_button, 0); gtk_widget_set_can_default(save_button, TRUE); + g_signal_connect ((gpointer) shellexec_conf_dialog, "destroy", + G_CALLBACK (on_shellexec_conf_dialog_destroy), + NULL); g_signal_connect ((gpointer) add_button, "clicked", G_CALLBACK (on_add_button_clicked), NULL); diff --git a/plugins/shellexecui/shellexec.glade b/plugins/shellexecui/shellexec.glade index aea894ae..aa872167 100644 --- a/plugins/shellexecui/shellexec.glade +++ b/plugins/shellexecui/shellexec.glade @@ -11,7 +11,7 @@ GTK_WIN_POS_NONE False True - False + True True False False @@ -20,6 +20,7 @@ True False False + diff --git a/plugins/shellexecui/shellexecui.c b/plugins/shellexecui/shellexecui.c index 482cec2b..6b6744dd 100644 --- a/plugins/shellexecui/shellexecui.c +++ b/plugins/shellexecui/shellexecui.c @@ -345,9 +345,20 @@ init_treeview() { g_object_unref(liststore); } +void +on_shellexec_conf_dialog_destroy (GObject *object, + gpointer user_data) +{ + conf_dlg = NULL; +} + + static gboolean shellexecui_action_gtk (void *data) { + if (conf_dlg) { + return FALSE; + } conf_dlg = create_shellexec_conf_dialog(); gtk_widget_set_size_request (conf_dlg, 400, 400); gtk_window_set_transient_for(GTK_WINDOW(conf_dlg), -- cgit v1.2.3 From 9f6762c3c9d4c6d60486e01b320e3b0aeb181499 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Fri, 27 Jun 2014 20:50:18 +0200 Subject: artwork: disable tracing --- plugins/artwork/artwork.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 64a1a11c..f577f0f5 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -70,8 +70,8 @@ static uintptr_t imlib_mutex; #define min(x,y) ((x)<(y)?(x):(y)) -#define trace(...) { fprintf(stderr, __VA_ARGS__); } -//#define trace(...) +//#define trace(...) { fprintf(stderr, __VA_ARGS__); } +#define trace(...) static char default_cover[PATH_MAX]; #define DEFAULT_FILEMASK "*cover*.jpg;*front*.jpg;*folder*.jpg;*cover*.png;*front*.png;*folder*.png" -- cgit v1.2.3 From 908b64c6eb608ae1266e1a168eb8e1f461a86ffb Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Fri, 27 Jun 2014 21:10:20 +0200 Subject: artwork: fixed caching for untagged files --- plugins/artwork/artwork.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index f577f0f5..94717931 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1167,7 +1167,7 @@ fetcher_thread (void *none) } if(! (is_ogg? FLAC__metadata_chain_read_ogg_with_callbacks(chain, (FLAC__IOHandle)file, iocb) : FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, iocb)) ) { - trace ("%s: ERROR: reading metadata", filename); + trace ("artwork: failed to read metadata from flac: %s\n", filename); deadbeef->fclose (file); FLAC__metadata_chain_delete(chain); break; @@ -1263,17 +1263,24 @@ fetcher_thread (void *none) if (files_count > 0) { trace ("found cover for %s - %s in local folder\n", param->artist, param->album); - if (check_dir (path, 0755)) { - strcat (path, "/"); - strcat (path, files[0]->d_name); - char cache_path[1024]; - char tmp_path[1024]; - make_cache_path2 (cache_path, sizeof (cache_path), param->fname, param->album, param->artist, -1); + strcat (path, "/"); + strcat (path, files[0]->d_name); + char cache_path[PATH_MAX]; + char tmp_path[PATH_MAX]; + char cache_path_dir[PATH_MAX]; + make_cache_path2 (cache_path, sizeof (cache_path), param->fname, param->album, param->artist, -1); + strcpy (cache_path_dir, cache_path); + char *slash = strrchr (cache_path_dir, '/'); + if (slash) { + *slash = 0; + } + trace ("check_dir: %s\n", cache_path_dir); + if (check_dir (cache_path_dir, 0755)) { snprintf (tmp_path, sizeof (tmp_path), "%s.part", cache_path); copy_file (path, tmp_path, -1); int err = rename (tmp_path, cache_path); if (err != 0) { - trace ("Failed to move %s to %s: %s\n", tmp_path, cache_path, strerror (err)); + trace ("artwork: rename error %d: failed to move %s to %s: %s\n", err, tmp_path, cache_path, strerror (err)); unlink (tmp_path); } int i; -- cgit v1.2.3 From db7caf339aff51556300c5b36a6e332c1d5c4567 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 28 Jun 2014 12:41:26 +0200 Subject: artwork: added libogg checks / linking --- plugins/artwork/Makefile.am | 9 +++++++-- plugins/artwork/artwork.c | 13 ++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/artwork/Makefile.am b/plugins/artwork/Makefile.am index 11f98e24..9840b5e1 100644 --- a/plugins/artwork/Makefile.am +++ b/plugins/artwork/Makefile.am @@ -2,6 +2,11 @@ if HAVE_ARTWORK artworkdir = $(libdir)/$(PACKAGE) pkglib_LTLIBRARIES = artwork.la +if HAVE_OGG +ogg_def = -DUSE_OGG=1 +ogg_libs = $(OGG_LIBS) +endif + if ARTWORK_USE_VFS_CURL artwork_net_cflags = -DUSE_VFS_CURL artwork_net_sources = albumartorg.c albumartorg.h lastfm.c lastfm.h wos.c wos.h escape.c escape.h @@ -24,6 +29,6 @@ FLAC_DEPS=$(FLAC_LIBS) flac_cflags=-DUSE_METAFLAC $(FLAC_CFLAGS) endif -AM_CFLAGS = $(CFLAGS) $(ARTWORK_CFLAGS) $(flac_cflags) $(artwork_net_cflags) -std=c99 -artwork_la_LIBADD = $(LDADD) $(ARTWORK_DEPS) $(FLAC_DEPS) +AM_CFLAGS = $(CFLAGS) $(ARTWORK_CFLAGS) $(flac_cflags) $(artwork_net_cflags) $(ogg_def) -std=c99 +artwork_la_LIBADD = $(LDADD) $(ARTWORK_DEPS) $(FLAC_DEPS) $(ogg_libs) endif diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 94717931..a6c27172 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1166,7 +1166,18 @@ fetcher_thread (void *none) break; } - if(! (is_ogg? FLAC__metadata_chain_read_ogg_with_callbacks(chain, (FLAC__IOHandle)file, iocb) : FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, iocb)) ) { + int res = 0; + if (is_ogg) { +#if USE_OGG + res = FLAC__metadata_chain_read_ogg_with_callbacks(chain, (FLAC__IOHandle)file, iocb); +#endif + } + else + { + res = FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, iocb); + } + + if(!res) { trace ("artwork: failed to read metadata from flac: %s\n", filename); deadbeef->fclose (file); FLAC__metadata_chain_delete(chain); -- cgit v1.2.3 From 695b61090949b301b2dccf084d44ab3970b8d508 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 28 Jun 2014 14:09:09 +0200 Subject: gme: glibc <2.4 compile fix --- plugins/gme/cgme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/gme/cgme.c b/plugins/gme/cgme.c index 712643e2..d172664e 100644 --- a/plugins/gme/cgme.c +++ b/plugins/gme/cgme.c @@ -85,7 +85,7 @@ read_gzfile (const char *fname, char **buffer, int *size) { tmp = "/tmp"; } char nm[PATH_MAX]; -#ifdef ANDROID +#if defined(ANDROID) || defined(STATICLINK) snprintf (nm, sizeof (nm), "%s/ddbgmeXXXXXX", tmp); fd = mkstemp (nm); #else -- cgit v1.2.3 From c541993e40e4355906ed34600a69ce62888aa697 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Fri, 4 Jul 2014 19:24:42 +0200 Subject: converter: additional fix for bug #1022 (incorrect wav data size in wave header) --- plugins/converter/converter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c index a0e7a218..806d6a0a 100644 --- a/plugins/converter/converter.c +++ b/plugins/converter/converter.c @@ -1019,7 +1019,7 @@ convert (DB_playItem_t *it, const char *out, int output_bps, int output_is_float } uint64_t chunksize; - chunksize = size + 36; + chunksize = size + 40; // for float, add 36 more if (output_is_float) { -- cgit v1.2.3 From 9d89e6910ef356caf626cbdb9d1d7104e3dc62ef Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 5 Jul 2014 20:51:55 +0200 Subject: artwork: fixed crash when showing album art in notification for untagged tracks (bug #1144) --- plugins/artwork/artwork.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index a6c27172..e69c61e4 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -144,10 +144,15 @@ make_cache_dir_path (char *path, int size, const char *artist, int img_size) { char esc_artist[PATH_MAX]; int i; - for (i = 0; artist[i]; i++) { - esc_artist[i] = esc_char (artist[i]); + if (artist) { + for (i = 0; artist[i]; i++) { + esc_artist[i] = esc_char (artist[i]); + } + esc_artist[i] = 0; + } + else { + strcpy (esc_artist, "Unknown artist"); } - esc_artist[i] = 0; const char *cache = getenv ("XDG_CACHE_HOME"); int sz; -- cgit v1.2.3 From 5ebe1b869b960078cbb26c0b90a848be9800ff18 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 5 Jul 2014 21:49:56 +0200 Subject: fixed artwork cache resetting in multiple places (bug #1143) --- plugins/artwork/artwork.c | 4 ++-- plugins/gtkui/coverart.c | 40 +++++++++++++++++++++++++++++++++++----- plugins/gtkui/coverart.h | 3 +++ plugins/gtkui/gtkui.c | 1 + plugins/gtkui/widgets.c | 3 +++ 5 files changed, 44 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index e69c61e4..32cd1b96 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -122,7 +122,7 @@ static time_t artwork_reset_time; static char artwork_filemask[200]; static const char *get_default_cover (void) { -return default_cover; + return default_cover; } static int @@ -1387,7 +1387,7 @@ find_image (const char *path) { // invalidate cache every 2 days if ((cache_period > 0 && (tm - stat_buf.st_mtime > cache_period * 60 * 60)) || artwork_reset_time > stat_buf.st_mtime) { - trace ("reloading cached file %s\n", path); + trace ("deleting cached file %s\n", path); unlink (path); return NULL; } diff --git a/plugins/gtkui/coverart.c b/plugins/gtkui/coverart.c index f7d78696..0ff63ceb 100644 --- a/plugins/gtkui/coverart.c +++ b/plugins/gtkui/coverart.c @@ -43,6 +43,7 @@ GdkPixbuf *pixbuf_default; typedef struct { struct timeval tm; + time_t file_time; char *fname; int width; GdkPixbuf *pixbuf; @@ -71,6 +72,8 @@ static uintptr_t tid; load_query_t *queue; load_query_t *tail; +static int64_t artwork_reset_time; + static void queue_add (const char *fname, int width, void (*callback) (void *user_data), void *user_data) { deadbeef->mutex_lock (mutex); @@ -175,11 +178,14 @@ loading_thread (void *none) { } GdkPixbuf *pixbuf = NULL; GError *error = NULL; - pixbuf = gdk_pixbuf_new_from_file_at_scale (queue->fname, queue->width, queue->width, TRUE, &error); - if (error) { - //fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", queue->fname, queue->width, error ? error->message : "n/a"); - g_error_free (error); - error = NULL; + struct stat stat_buf; + if (!stat (queue->fname, &stat_buf)) { + pixbuf = gdk_pixbuf_new_from_file_at_scale (queue->fname, queue->width, queue->width, TRUE, &error); + if (error) { + //fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", queue->fname, queue->width, error ? error->message : "n/a"); + g_error_free (error); + error = NULL; + } } if (!pixbuf) { pixbuf = pixbuf_default; @@ -189,6 +195,7 @@ loading_thread (void *none) { deadbeef->mutex_lock (mutex); cache[cache_min].pixbuf = pixbuf; cache[cache_min].fname = strdup (queue->fname); + cache[cache_min].file_time = stat_buf.st_mtime; gettimeofday (&cache[cache_min].tm, NULL); cache[cache_min].width = queue->width; deadbeef->mutex_unlock (mutex); @@ -406,3 +413,26 @@ int gtkui_is_default_pixbuf (GdkPixbuf *pb) { return pb == pixbuf_default; } + +int +gtkui_cover_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) { + switch (id) { + case DB_EV_PLAYLIST_REFRESH: + { + int64_t reset_time = deadbeef->conf_get_int64 ("artwork.cache_reset_time", 0);; + if (reset_time != artwork_reset_time) { + artwork_reset_time = reset_time; + deadbeef->mutex_lock (mutex); + for (int i = 0; i < CACHE_SIZE; i++) { + if (cache[i].pixbuf) { + g_object_unref (cache[i].pixbuf); + } + } + memset (cache, 0, sizeof (cache)); + deadbeef->mutex_unlock (mutex); + } + } + break; + } + return 0; +} diff --git a/plugins/gtkui/coverart.h b/plugins/gtkui/coverart.h index bacbfd92..47627fe7 100644 --- a/plugins/gtkui/coverart.h +++ b/plugins/gtkui/coverart.h @@ -51,5 +51,8 @@ cover_get_default_pixbuf (void); int gtkui_is_default_pixbuf (GdkPixbuf *pb); +int +gtkui_cover_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2); + #endif diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 5e2cbd2f..a3cca159 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -772,6 +772,7 @@ gtkui_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) { if (rootwidget) { send_messages_to_widgets (rootwidget, id, ctx, p1, p2); } + gtkui_cover_message (id, ctx, p1, p2); switch (id) { case DB_EV_ACTIVATED: g_idle_add (activate_cb, NULL); diff --git a/plugins/gtkui/widgets.c b/plugins/gtkui/widgets.c index 1bacb50e..51b37c28 100644 --- a/plugins/gtkui/widgets.c +++ b/plugins/gtkui/widgets.c @@ -2349,6 +2349,9 @@ static int coverart_message (ddb_gtkui_widget_t *w, uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) { w_coverart_t *ca = (w_coverart_t *)w; switch (id) { + case DB_EV_PLAYLIST_REFRESH: + g_idle_add (coverart_redraw_cb, w); + break; case DB_EV_SONGSTARTED: g_idle_add (coverart_redraw_cb, w); break; -- cgit v1.2.3 From e10994169fbae93890eb13af423aa89556eafb6e Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sun, 6 Jul 2014 10:31:41 +0200 Subject: converter: fixed edit/remove buttons --- plugins/converter/convgui.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') diff --git a/plugins/converter/convgui.c b/plugins/converter/convgui.c index e1ebdfb1..a1207da2 100644 --- a/plugins/converter/convgui.c +++ b/plugins/converter/convgui.c @@ -911,6 +911,7 @@ on_encoder_preset_cursor_changed (GtkTreeView *treeview, gpointer user_data) { GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (treeview)); GtkWidget *edit = lookup_widget (toplevel, "edit"); + GtkWidget *remove = lookup_widget (toplevel, "remove"); GtkTreePath *path; GtkTreeViewColumn *col; @@ -918,6 +919,7 @@ on_encoder_preset_cursor_changed (GtkTreeView *treeview, if (!path || !col) { // nothing selected gtk_widget_set_sensitive (edit, FALSE); + gtk_widget_set_sensitive (remove, FALSE); return; } int *indices = gtk_tree_path_get_indices (path); @@ -926,6 +928,7 @@ on_encoder_preset_cursor_changed (GtkTreeView *treeview, ddb_encoder_preset_t *p = converter_plugin->encoder_preset_get_for_idx (idx); gtk_widget_set_sensitive (edit, !p->readonly); + gtk_widget_set_sensitive (remove, !p->readonly); } -- cgit v1.2.3 From d012d39f4d256d43cd5e2d95a96f4868fbedd464 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sun, 6 Jul 2014 10:43:42 +0200 Subject: converter: strip subtrack metadata from converted result before writing tags, this fixes bug #1104 (writing tags to ogg/flac files after converting them from chained tracks) --- plugins/converter/converter.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c index 806d6a0a..fc8989c4 100644 --- a/plugins/converter/converter.c +++ b/plugins/converter/converter.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "converter.h" #include "../../deadbeef.h" #include "../../strdupa.h" @@ -1058,7 +1059,7 @@ convert (DB_playItem_t *it, const char *out, int output_bps, int output_is_float int64_t res = write (temp_file, buffer, sz); if (sz != res) { - fprintf (stderr, "converter: write error (%lld bytes written out of %d)\n", res, sz); + fprintf (stderr, "converter: write error (%"PRId64" bytes written out of %d)\n", res, sz); goto error; } } @@ -1133,8 +1134,11 @@ error: *o++ = *p++; } *o = 0; + // FIXME: need to delete all colon-fields, except the URI deadbeef->pl_replace_meta (out_it, ":URI", unesc_path); + deadbeef->pl_delete_meta (out_it, ":TRACKNUM"); deadbeef->pl_delete_meta (out_it, "cuesheet"); + deadbeef->pl_set_item_flags (out_it, 0); } uint32_t tagflags = 0; -- cgit v1.2.3