diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/adplug/adplug-db.cpp | 2 | ||||
-rw-r--r-- | plugins/alsa/alsa.c | 5 | ||||
-rw-r--r-- | plugins/ffap/ffap.c | 8 | ||||
-rw-r--r-- | plugins/gtkui/gtkplaylist.c | 27 | ||||
-rw-r--r-- | plugins/hotkeys/hotkeys.c | 5 | ||||
-rw-r--r-- | plugins/nullout/nullout.c | 18 |
6 files changed, 15 insertions, 50 deletions
diff --git a/plugins/adplug/adplug-db.cpp b/plugins/adplug/adplug-db.cpp index a76550b9..6c15804d 100644 --- a/plugins/adplug/adplug-db.cpp +++ b/plugins/adplug/adplug-db.cpp @@ -124,7 +124,7 @@ adplug_read_int16 (char *bytes, int size) { } currentsample += size/4; adplug_plugin.info.readpos = (float)currentsample / adplug_plugin.info.samplerate; - return size; + return initsize-size; } int diff --git a/plugins/alsa/alsa.c b/plugins/alsa/alsa.c index 23470765..22c3e9b3 100644 --- a/plugins/alsa/alsa.c +++ b/plugins/alsa/alsa.c @@ -165,7 +165,7 @@ palsa_set_hw_params (int samplerate) { trace ("Unable to get buffer size for playback: %s\n", snd_strerror(err)); goto error; } - trace ("alsa buffer size: %d frames\n", size); + trace ("alsa buffer size: %d frames\n", (int)size); bufsize = size; if ((err = snd_pcm_hw_params (audio, hw_params)) < 0) { @@ -227,7 +227,7 @@ palsa_init (void) { snd_strerror (err)); goto open_error; } - trace ("alsa period size: %d frames\n", av); + trace ("alsa period size: %d frames\n", (int)av); if ((err = snd_pcm_sw_params_set_start_threshold (audio, sw_params, 0U)) < 0) { trace ("cannot set start mode (%s)\n", @@ -299,6 +299,7 @@ palsa_free (void) { trace ("palsa_free\n"); if (audio && !alsa_terminate) { alsa_terminate = 1; + printf ("waiting for alsa thread to finish\n"); deadbeef->thread_join (alsa_tid); alsa_tid = 0; snd_pcm_close(audio); diff --git a/plugins/ffap/ffap.c b/plugins/ffap/ffap.c index 5a3bf1f4..e04ca40d 100644 --- a/plugins/ffap/ffap.c +++ b/plugins/ffap/ffap.c @@ -609,9 +609,9 @@ static int ape_read_packet(DB_FILE *fp, APEContext *ape_ctx) // packet_sizeleft -= 8; // update bitrate - float sec = (float)nblocks / ape->samplerate; int bitrate = -1; - if (sec != 0 && ape->frames[ape->currentframe].size != 0) { + if (nblocks != 0 && ape->frames[ape->currentframe].size != 0) { + float sec = (float)nblocks / ape->samplerate; bitrate = ape->frames[ape->currentframe].size / sec * 8; } if (bitrate > 0) { @@ -1664,7 +1664,7 @@ ffap_insert (DB_playItem_t *after, const char *fname) { it->filetype = "APE"; deadbeef->pl_set_item_duration (it, duration); - int v2err = deadbeef->junk_read_id3v2 (it, fp); + /*int v2err = */deadbeef->junk_read_id3v2 (it, fp); int v1err = deadbeef->junk_read_id3v1 (it, fp); if (v1err >= 0) { deadbeef->fseek (fp, -128, SEEK_END); @@ -1672,7 +1672,7 @@ ffap_insert (DB_playItem_t *after, const char *fname) { else { deadbeef->fseek (fp, 0, SEEK_END); } - int apeerr = deadbeef->junk_read_ape (it, fp); + /*int apeerr = */deadbeef->junk_read_ape (it, fp); deadbeef->fclose (fp); diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c index dcfabe32..4a112107 100644 --- a/plugins/gtkui/gtkplaylist.c +++ b/plugins/gtkui/gtkplaylist.c @@ -284,7 +284,6 @@ gtkpl_setup_hscrollbar (gtkplaylist_t *ps) { GtkWidget *playlist = ps->playlist; int w = playlist->allocation.width; int size = 0; - int i; gtkpl_column_t *c; for (c = ps->columns; c; c = c->next) { size += c->width; @@ -348,7 +347,6 @@ gtkpl_draw_pl_row_back (gtkplaylist_t *ps, int row, DB_playItem_t *it) { GTK_OBJECT_FLAGS (treeview) |= GTK_HAS_FOCUS; int x = -ps->hscrollpos; int w = ps->totalwidth; - GtkWidget *widget = ps->playlist; gtk_paint_flat_box (treeview->style, ps->backbuf, (it && SELECTED(it)) ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL, treeview, (row & 1) ? "cell_even_ruled" : "cell_odd_ruled", x, row * rowheight - ps->scrollpos * rowheight, w, rowheight); if (row == deadbeef->pl_get_cursor (ps->iterator)) { // not all gtk engines/themes render focus rectangle in treeviews @@ -399,13 +397,11 @@ gtkpl_draw_pl_row (gtkplaylist_t *ps, int row, DB_playItem_t *it) { char text[1024]; deadbeef->pl_format_title (it, text, sizeof (text), c->id, c->format); - if (text) { - if (c->align_right) { - draw_text (x+5, row * rowheight - ps->scrollpos * rowheight + rowheight/2 - draw_get_font_size ()/2 - 2, c->width-10, 1, text); - } - else { - draw_text (x + 5, row * rowheight - ps->scrollpos * rowheight + rowheight/2 - draw_get_font_size ()/2 - 2, c->width-10, 0, text); - } + if (c->align_right) { + draw_text (x+5, row * rowheight - ps->scrollpos * rowheight + rowheight/2 - draw_get_font_size ()/2 - 2, c->width-10, 1, text); + } + else { + draw_text (x + 5, row * rowheight - ps->scrollpos * rowheight + rowheight/2 - draw_get_font_size ()/2 - 2, c->width-10, 0, text); } } x += c->width; @@ -415,7 +411,6 @@ gtkpl_draw_pl_row (gtkplaylist_t *ps, int row, DB_playItem_t *it) { void gtkpl_draw_playlist (gtkplaylist_t *ps, int x, int y, int w, int h) { - GtkWidget *widget = ps->playlist; if (!ps->backbuf) { return; } @@ -493,7 +488,6 @@ gtkpl_expose_header (gtkplaylist_t *ps, int x, int y, int w, int h) { void gtkpl_select_single (gtkplaylist_t *ps, int sel) { int idx=0; - GtkWidget *widget = ps->playlist; DB_playItem_t *it = PL_HEAD (ps->iterator); for (; it; it = PL_NEXT (it, ps->iterator), idx++) { if (idx == sel) { @@ -540,7 +534,6 @@ gtkpl_mouse1_pressed (gtkplaylist_t *ps, int state, int ex, int ey, double time) if (cnt == 0) { return; } - GtkWidget *widget = ps->playlist; // remember mouse coords for doubleclick detection ps->lastpos[0] = ex; ps->lastpos[1] = ey; @@ -754,7 +747,6 @@ gtkpl_mousemove (gtkplaylist_t *ps, GdkEventMotion *event) { } } else if (areaselect) { - GtkWidget *widget = ps->playlist; int y = event->y/rowheight + ps->scrollpos; //if (y != shift_sel_anchor) { @@ -817,7 +809,6 @@ gtkpl_handle_scroll_event (gtkplaylist_t *ps, int direction) { return; } // pass event to scrollbar - GtkAdjustment* adj = gtk_range_get_adjustment (GTK_RANGE (range)); int newscroll = gtk_range_get_value (GTK_RANGE (range)); if (direction == GDK_SCROLL_UP) { newscroll -= 2; @@ -877,7 +868,6 @@ gtkpl_hscroll (gtkplaylist_t *ps, int newscroll) { void gtkpl_songchanged (gtkplaylist_t *ps, int from, int to) { if (!dragwait && to != -1) { - GtkWidget *widget = ps->playlist; if (deadbeef->conf_get_int ("playlist.scroll.followplayback", 0)) { if (to < ps->scrollpos || to >= ps->scrollpos + ps->nvisiblefullrows) { gtk_range_set_value (GTK_RANGE (ps->scrollbar), to - ps->nvisiblerows/2); @@ -898,7 +888,6 @@ gtkpl_songchanged (gtkplaylist_t *ps, int from, int to) { void gtkpl_keypress (gtkplaylist_t *ps, int keyval, int state) { - GtkWidget *widget = ps->playlist; GtkWidget *range = ps->scrollbar; int prev = deadbeef->pl_get_cursor (ps->iterator); int newscroll = ps->scrollpos; @@ -953,8 +942,6 @@ gtkpl_keypress (gtkplaylist_t *ps, int keyval, int state) { if (state & GDK_SHIFT_MASK) { // select all between shift_sel_anchor and deadbeef->pl_get_cursor (ps->iterator) if (prev != deadbeef->pl_get_cursor (ps->iterator)) { - int minvis = ps->scrollpos; - int maxvis = ps->scrollpos + ps->nvisiblerows-1; int start = min (deadbeef->pl_get_cursor (ps->iterator), shift_sel_anchor); int end = max (deadbeef->pl_get_cursor (ps->iterator), shift_sel_anchor); int idx=0; @@ -972,8 +959,6 @@ gtkpl_keypress (gtkplaylist_t *ps, int keyval, int state) { else { // reset selection, set new single cursor/selection if (prev != deadbeef->pl_get_cursor (ps->iterator)) { - int minvis = ps->scrollpos; - int maxvis = ps->scrollpos + ps->nvisiblerows-1; shift_sel_anchor = deadbeef->pl_get_cursor (ps->iterator); int idx=0; for (DB_playItem_t *it = PL_HEAD (ps->iterator); it; it = PL_NEXT(it, ps->iterator), idx++) { @@ -1359,8 +1344,6 @@ on_header_motion_notify_event (GtkWidget *widget, x += cc->width; } if (inspos >= 0 && inspos != header_dragging) { - int c1 = inspos; - int c2 = header_dragging; // remove c from list if (c == ps->columns) { ps->columns = c->next; diff --git a/plugins/hotkeys/hotkeys.c b/plugins/hotkeys/hotkeys.c index 2394634b..7d292f10 100644 --- a/plugins/hotkeys/hotkeys.c +++ b/plugins/hotkeys/hotkeys.c @@ -33,7 +33,7 @@ static intptr_t loop_tid; #define MAX_COMMAND_COUNT 256 typedef struct { - char *name; + const char *name; KeySym keysym; } xkey_t; @@ -66,7 +66,7 @@ get_keycode (Display *disp, const char* name) { static KeySym* syms; static int ks_per_kk; static int first_time = 1; - int i, j, ks; + int i, ks; if (first_time) { @@ -197,7 +197,6 @@ read_config (Display *disp) char* command = colon+1; *colon = 0; - int modifier = 0; char* key = NULL; int done = 0; diff --git a/plugins/nullout/nullout.c b/plugins/nullout/nullout.c index 5f3dd996..1e08121b 100644 --- a/plugins/nullout/nullout.c +++ b/plugins/nullout/nullout.c @@ -55,12 +55,6 @@ static int pnull_stop (void); static int -pnull_isstopped (void); - -static int -pnull_ispaused (void); - -static int pnull_pause (void); static int @@ -126,17 +120,6 @@ pnull_stop (void) { } int -pnull_isstopped (void) { - return (state == OUTPUT_STATE_STOPPED); -} - -int -pnull_ispaused (void) { - // return pause state - return (state == OUTPUT_STATE_PAUSED); -} - -int pnull_pause (void) { if (state == OUTPUT_STATE_STOPPED) { return -1; @@ -182,7 +165,6 @@ pnull_get_endianness (void) { static void pnull_thread (void *context) { prctl (PR_SET_NAME, "deadbeef-null", 0, 0, 0, 0); - int err; for (;;) { if (null_terminate) { break; |