summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rw-r--r--configure.ac48
-rw-r--r--deadbeef.h11
-rw-r--r--dumb/dumb-kode54/src/it/readpsm.c4
-rw-r--r--main.c4
-rw-r--r--playlist.c28
-rw-r--r--playlist.h2
-rw-r--r--plugins.c2
-rw-r--r--plugins/alsa/alsa.c8
-rw-r--r--plugins/gtkui/callbacks.c8
-rw-r--r--plugins/gtkui/deadbeef.glade6
-rw-r--r--plugins/gtkui/gtkplaylist.c2
-rw-r--r--plugins/gtkui/interface.c3
-rw-r--r--plugins/notification/Makefile.am5
-rw-r--r--plugins/notification/notification.c63
-rw-r--r--plugins/oss/Makefile.am2
-rw-r--r--plugins/oss/oss.c33
-rw-r--r--plugins/vorbis/vorbis.c2
-rw-r--r--streamer.c5
-rw-r--r--web/faq.txt59
-rw-r--r--web/index.html6
21 files changed, 249 insertions, 55 deletions
diff --git a/Makefile.am b/Makefile.am
index ea9e0e3e..aa8e6b12 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,6 +7,7 @@ SUBDIRS = ${MPGMAD_DIR}\
plugins/nullout\
plugins/sid\
plugins/ffap\
+ plugins/notification\
${ALSA_DIR}\
${LFM_DIR}\
${VFS_CURL_DIR}\
@@ -15,7 +16,7 @@ SUBDIRS = ${MPGMAD_DIR}\
${FFMPEG_DIR}\
${FLAC_DIR}\
${SNDFILE_DIR}\
- ${OSS4_DIR}
+ ${OSS_DIR}
#SUBDIRS = gme/Game_Music_Emu-0.5.2\
# sid/sidplay-libs-2.1.0\
diff --git a/configure.ac b/configure.ac
index fcbe5930..c7b6761d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,8 +35,8 @@ esac
test "x$prefix" = xNONE && prefix=$ac_default_prefix
-INSANE_CFLAGS="-Wcomment -Wchar-subscripts -Wunused-function -Wunused-value -Wuninitialized -Wtype-limits -Wbad-function-cast"
-INSANE_CXXFLAGS="-Wcomment -Wchar-subscripts -Wunused-function -Wunused-value -Wuninitialized -Wtype-limits"
+dnl INSANE_CFLAGS="-Wcomment -Wchar-subscripts -Wunused-function -Wunused-value -Wuninitialized -Wtype-limits -Wbad-function-cast"
+dnl INSANE_CXXFLAGS="-Wcomment -Wchar-subscripts -Wunused-function -Wunused-value -Wuninitialized -Wtype-limits"
AC_SUBST(INSANE_CFLAGS)
AC_SUBST(INSANE_CXXFLAGS)
@@ -179,19 +179,19 @@ if test ${HAVE_FFMPEG}; then
AC_SUBST(FFMPEG_DIR)
fi
-dnl *** OSS4 output (partly stolen from audacious)
-have_oss4=no
+dnl *** OSS output (partly stolen from audacious)
+have_oss=no
-AC_MSG_CHECKING(for OSS4 include dir)
-OSS4_CFLAGS=""
+AC_MSG_CHECKING(for OSS include dir)
+OSS_CFLAGS=""
if test -f "/etc/oss.conf" ; then
for i in `cat /etc/oss.conf`; do
t=`echo $i | sed -e 's/OSSLIBDIR=//'`
if test "x$i" != "x$t" ; then
if test -f "$t/include/sys/soundcard.h" -o -f "$i/include/soundcard.h" ; then
- OSS4_CFLAGS="-I$t/include"
- AC_MSG_RESULT([$OSS4_CFLAGS])
- have_oss4=yes
+ OSS_CFLAGS="-I$t/include/sys"
+ AC_MSG_RESULT([$OSS_CFLAGS])
+ have_oss=yes
fi
fi
done
@@ -199,11 +199,11 @@ else
AC_MSG_RESULT([not found])
fi
-if test "x$have_oss4" != "xyes"; then
- AC_MSG_CHECKING(for /usr/include/sys/soundcard.h)
+if test "x$have_oss" != "xyes"; then
+ AC_MSG_CHECKING(for sys/soundcard.h)
AC_CHECK_HEADERS(sys/soundcard.h)
if test "x${ac_cv_header_sys_soundcard_h}" = "xyes" ; then
- have_oss4=yes
+ have_oss=yes
AC_MSG_RESULT([found])
else
AC_MSG_RESULT([not found])
@@ -211,18 +211,18 @@ if test "x$have_oss4" != "xyes"; then
fi
-if test "x$have_oss4" = "xyes"; then
- OSS4_DIR="plugins/oss"
- AC_SUBST(OSS4_CFLAGS)
- AC_SUBST(OSS4_DIR)
+if test "x$have_oss" = "xyes"; then
+ OSS_DIR="plugins/oss"
+ AC_SUBST(OSS_CFLAGS)
+ AC_SUBST(OSS_DIR)
fi
-echo
-echo "have_oss4=$have_oss4"
-echo "OSS4_CFLAGS=$OSS4_CFLAGS"
-echo "OSS4_LIBS=$OSS4_LIBS"
-echo "OSS4_DIR=$OSS4_DIR"
-echo
+dnl echo
+dnl echo "have_oss=$have_oss"
+dnl echo "OSS_CFLAGS=$OSS_CFLAGS"
+dnl echo "OSS_LIBS=$OSS_LIBS"
+dnl echo "OSS_DIR=$OSS_DIR"
+dnl echo
dnl print summary
@@ -260,7 +260,8 @@ dnl PRINT_PLUGIN_INFO([faad2],[aac/mp4 player],[test $HAVE_FAAD && test $HAVE_MP
PRINT_PLUGIN_INFO([cdda],[cd audio player],[test $HAVE_CDIO && test $HAVE_CDDB])
PRINT_PLUGIN_INFO([gtkui],[GTK user interface],[test $HAVE_GTK])
PRINT_PLUGIN_INFO([ffmpeg],[ffmpeg codecs],[test $HAVE_FFMPEG])
-PRINT_PLUGIN_INFO([oss],[oss4 output plugin],[test "x$have_oss4" = "xyes"])
+PRINT_PLUGIN_INFO([notification],[Current track notification],[true])
+PRINT_PLUGIN_INFO([oss],[oss output plugin],[test "x$have_oss" = "xyes"])
echo
AC_OUTPUT([
@@ -288,6 +289,7 @@ plugins/vtx/Makefile
plugins/adplug/Makefile
plugins/ffmpeg/Makefile
plugins/sid/Makefile
+plugins/notification/Makefile
plugins/oss/Makefile
deadbeef.desktop
])
diff --git a/deadbeef.h b/deadbeef.h
index f52c4fad..ca63cda1 100644
--- a/deadbeef.h
+++ b/deadbeef.h
@@ -53,7 +53,8 @@ extern "C" {
// DON'T release plugins without DB_PLUGIN_SET_API_VERSION
// api version history:
-// 0.6 -- devel
+// 0.7 -- devel
+// 0.6 -- deadbeef-0.3.3
// 0.5 -- deadbeef-0.3.2
// 0.4 -- deadbeef-0.3.0
// 0.3 -- deadbeef-0.2.3.2
@@ -61,7 +62,7 @@ extern "C" {
// 0.1 -- deadbeef-0.2.0
#define DB_API_VERSION_MAJOR 0
-#define DB_API_VERSION_MINOR 6
+#define DB_API_VERSION_MINOR 7
#define DB_PLUGIN_SET_API_VERSION\
.plugin.api_vmajor = DB_API_VERSION_MAJOR,\
@@ -177,6 +178,7 @@ enum {
// preset columns, working using IDs
enum pl_column_t {
+ DB_COLUMN_FILENUMBER = 0,
DB_COLUMN_PLAYING = 1,
DB_COLUMN_ARTIST_ALBUM = 2,
DB_COLUMN_ARTIST = 3,
@@ -184,7 +186,7 @@ enum pl_column_t {
DB_COLUMN_TITLE = 5,
DB_COLUMN_DURATION = 6,
DB_COLUMN_TRACK = 7,
- DB_COLUMN_ID_MAX = 7
+ DB_COLUMN_ID_MAX
};
// message ids for communicating with player
@@ -308,6 +310,7 @@ typedef struct {
/*
this function formats line for display in playlist
@it pointer to playlist item
+ @idx number of that item in playlist (or -1)
@s output buffer
@size size of output buffer
@id one of IDs defined in pl_column_id_t enum, can be -1
@@ -324,7 +327,7 @@ typedef struct {
%r copyright
more to come
*/
- int (*pl_format_title) (DB_playItem_t *it, char *s, int size, int id, const char *fmt);
+ int (*pl_format_title) (DB_playItem_t *it, int idx, char *s, int size, int id, const char *fmt);
void (*pl_format_item_display_name) (DB_playItem_t *it, char *str, int len);
// void (*pl_set_next) (DB_playItem_t *it, DB_playItem_t *next, int iter);
// void (*pl_set_prev) (DB_playItem_t *it, DB_playItem_t *prev, int iter);
diff --git a/dumb/dumb-kode54/src/it/readpsm.c b/dumb/dumb-kode54/src/it/readpsm.c
index bf30f2d0..129cdf6f 100644
--- a/dumb/dumb-kode54/src/it/readpsm.c
+++ b/dumb/dumb-kode54/src/it/readpsm.c
@@ -1216,7 +1216,7 @@ int pattcmp( const unsigned char * a, const unsigned char * b, size_t l )
if ( i < l )
{
na = strtoul( a + i, &p, 10 );
- if ( p == a + i ) return 1;
+ if ( (const unsigned char *)p == a + i ) return 1;
}
for ( j = 0; j < l; ++j )
@@ -1227,7 +1227,7 @@ int pattcmp( const unsigned char * a, const unsigned char * b, size_t l )
if ( j < l )
{
nb = strtoul( b + j, &p, 10 );
- if ( p == b + j ) return -1;
+ if ( (const unsigned char *)p == b + j ) return -1;
}
if ( i < j ) return -1;
diff --git a/main.c b/main.c
index 356a08a6..de00f988 100644
--- a/main.c
+++ b/main.c
@@ -131,7 +131,7 @@ server_exec_command_line (const char *cmdline, int len, char *sendback, int sbsi
if (curr && dec) {
const char np[] = "nowplaying ";
memcpy (sendback, np, sizeof (np)-1);
- pl_format_title (curr, sendback+sizeof(np)-1, sbsize-sizeof(np)+1, -1, parg);
+ pl_format_title (curr, -1, sendback+sizeof(np)-1, sbsize-sizeof(np)+1, -1, parg);
}
else {
strcpy (sendback, "nowplaying nothing");
@@ -142,7 +142,7 @@ server_exec_command_line (const char *cmdline, int len, char *sendback, int sbsi
playItem_t *curr = streamer_get_playing_track ();
DB_fileinfo_t *dec = streamer_get_current_decoder ();
if (curr && dec) {
- pl_format_title (curr, out, sizeof (out), -1, parg);
+ pl_format_title (curr, -1, out, sizeof (out), -1, parg);
}
else {
strcpy (out, "nothing");
diff --git a/playlist.c b/playlist.c
index 79701b88..bdeb5ca3 100644
--- a/playlist.c
+++ b/playlist.c
@@ -1576,9 +1576,10 @@ pl_format_elapsed (const char *ret, char *elapsed, int size) {
}
int
-pl_format_title (playItem_t *it, char *s, int size, int id, const char *fmt) {
+pl_format_title (playItem_t *it, int idx, char *s, int size, int id, const char *fmt) {
char dur[50];
char elp[50];
+ char fno[50];
const char *artist = NULL;
const char *album = NULL;
const char *track = NULL;
@@ -1589,10 +1590,18 @@ pl_format_title (playItem_t *it, char *s, int size, int id, const char *fmt) {
const char *genre = NULL;
const char *comment = NULL;
const char *copyright = NULL;
+ const char *filename = NULL;
if (id != -1) {
const char *text = NULL;
switch (id) {
+ case DB_COLUMN_FILENUMBER:
+ if (idx == -1) {
+ idx = pl_get_idx_of (it);
+ }
+ snprintf (fno, sizeof (fno), "%d", idx+1);
+ text = fno;
+ break;
case DB_COLUMN_PLAYING:
return pl_format_item_queue (it, s, size);
case DB_COLUMN_ARTIST_ALBUM:
@@ -1692,6 +1701,16 @@ pl_format_title (playItem_t *it, char *s, int size, int id, const char *fmt) {
n--;
}
}
+ else if (*fmt == 'f') {
+ filename = it->fname + strlen (it->fname) - 1;
+ while (filename > it->fname && (*filename) != '/') {
+ filename--;
+ }
+ if (*filename == '/') {
+ filename++;
+ }
+ meta = filename;
+ }
else {
*s++ = *fmt;
n--;
@@ -1714,6 +1733,9 @@ pl_format_title (playItem_t *it, char *s, int size, int id, const char *fmt) {
void
pl_sort (int iter, int id, const char *format, int ascending) {
+ if (id == DB_COLUMN_FILENUMBER) {
+ return;
+ }
int sorted = 0;
do {
sorted = 1;
@@ -1743,8 +1765,8 @@ pl_sort (int iter, int id, const char *format, int ascending) {
}
}
else {
- pl_format_title (it, title1, sizeof (title1), id, format);
- pl_format_title (next, title2, sizeof (title2), id, format);
+ pl_format_title (it, -1, title1, sizeof (title1), id, format);
+ pl_format_title (next, -1, title2, sizeof (title2), id, format);
}
int cmp = ascending ? strcmp (title1, title2) < 0 : strcmp (title1, title2) > 0;
if (cmp) {
diff --git a/playlist.h b/playlist.h
index 59c67139..0fb5ad84 100644
--- a/playlist.h
+++ b/playlist.h
@@ -177,7 +177,7 @@ pl_get_item_duration (playItem_t *it);
// returns number of characters printed, not including trailing 0
// [a]rtist, [t]itle, al[b]um, [l]ength, track[n]umber
int
-pl_format_title (playItem_t *it, char *s, int size, int id, const char *fmt);
+pl_format_title (playItem_t *it, int idx, char *s, int size, int id, const char *fmt);
void
pl_reset_cursor (void);
diff --git a/plugins.c b/plugins.c
index b39876dd..384512c4 100644
--- a/plugins.c
+++ b/plugins.c
@@ -122,7 +122,7 @@ static DB_functions_t deadbeef_api = {
.pl_get_last = (DB_playItem_t *(*) (int))pl_get_last,
.pl_get_next = (DB_playItem_t *(*) (DB_playItem_t *, int))pl_get_next,
.pl_get_prev = (DB_playItem_t *(*) (DB_playItem_t *, int))pl_get_prev,
- .pl_format_title = (int (*) (DB_playItem_t *it, char *s, int size, int id, const char *fmt))pl_format_title,
+ .pl_format_title = (int (*) (DB_playItem_t *it, int idx, char *s, int size, int id, const char *fmt))pl_format_title,
.pl_format_item_display_name = (void (*) (DB_playItem_t *it, char *str, int len))pl_format_item_display_name,
.pl_move_items = (void (*) (int iter, DB_playItem_t *drop_before, uint32_t *indexes, int count))pl_move_items,
.pl_search_reset = pl_search_reset,
diff --git a/plugins/alsa/alsa.c b/plugins/alsa/alsa.c
index 3f37e8ec..9d6e35d8 100644
--- a/plugins/alsa/alsa.c
+++ b/plugins/alsa/alsa.c
@@ -474,6 +474,14 @@ palsa_thread (void *context) {
/* deliver the data */
// FIXME: under some conditions, frames_to_deliver may become huge
// like 20M. this case is not handled here.
+ if (frames_to_deliver < 1024) {
+ trace ("alsa: frames_to_deliver clipped from %d to 1024\n", frames_to_deliver);
+ frames_to_deliver = 1024;
+ }
+ else if (frames_to_deliver > 2048) {
+ trace ("alsa: frames_to_deliver clipped from %d to 2048\n", frames_to_deliver);
+ frames_to_deliver = 2048;
+ }
char buf[frames_to_deliver*4];
palsa_callback (buf, frames_to_deliver*4);
if ((err = snd_pcm_writei (audio, buf, frames_to_deliver)) < 0) {
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index c256d18c..c0df2f66 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -1791,9 +1791,9 @@ on_add_column_activate (GtkMenuItem *menuitem,
if (response == GTK_RESPONSE_OK) {
const gchar *title = gtk_entry_get_text (GTK_ENTRY (lookup_widget (dlg, "title")));
const gchar *format = gtk_entry_get_text (GTK_ENTRY (lookup_widget (dlg, "format")));
- int id = gtk_combo_box_get_active (GTK_COMBO_BOX (lookup_widget (dlg, "id"))) + 1;
+ int id = gtk_combo_box_get_active (GTK_COMBO_BOX (lookup_widget (dlg, "id")));
int align = gtk_combo_box_get_active (GTK_COMBO_BOX (lookup_widget (dlg, "align")));
- if (id > DB_COLUMN_ID_MAX) {
+ if (id >= DB_COLUMN_ID_MAX) {
id = -1;
}
gtkpl_column_insert_before (ps, ps->active_column, gtkpl_column_alloc (title, 100, id, format, align));
@@ -1883,13 +1883,13 @@ on_column_id_changed (GtkComboBox *combobox,
trace ("failed to get toplevel widget for column id combobox\n");
return;
}
- int act = gtk_combo_box_get_active (combobox) + 1;
+ int act = gtk_combo_box_get_active (combobox);
GtkWidget *fmt = lookup_widget (toplevel, "format");
if (!fmt) {
trace ("failed to get column format widget\n");
return;
}
- gtk_widget_set_sensitive (fmt, act > DB_COLUMN_ID_MAX ? TRUE : FALSE);
+ gtk_widget_set_sensitive (fmt, act >= DB_COLUMN_ID_MAX ? TRUE : FALSE);
}
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index cfd07055..022a1515 100644
--- a/plugins/gtkui/deadbeef.glade
+++ b/plugins/gtkui/deadbeef.glade
@@ -3218,7 +3218,8 @@ SOCKS5_HOSTNAME</property>
<child>
<widget class="GtkComboBox" id="id">
<property name="visible">True</property>
- <property name="items" translatable="yes">Playing
+ <property name="items" translatable="yes">File number
+Playing
Artist - Album
Artist
Album
@@ -3295,7 +3296,8 @@ Custom</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Format conversions (start with %):
[a]rtist, [t]itle, al[b]um, track[n]umber,
- [l]ength, [y]ear, [g]enre, [c]omment, copy[r]ight
+ [l]ength, [y]ear, [g]enre, [c]omment,
+ copy[r]ight, [f]ilename
Example: %a - %t [%l]</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c
index 762be03f..22fcf630 100644
--- a/plugins/gtkui/gtkplaylist.c
+++ b/plugins/gtkui/gtkplaylist.c
@@ -396,7 +396,7 @@ gtkpl_draw_pl_row (gtkplaylist_t *ps, int row, DB_playItem_t *it) {
}
else {
char text[1024];
- deadbeef->pl_format_title (it, text, sizeof (text), c->id, c->format);
+ deadbeef->pl_format_title (it, row, text, sizeof (text), c->id, c->format);
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);
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index 0b614e97..ca824c85 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -2083,6 +2083,7 @@ create_editcolumndlg (void)
gtk_table_attach (GTK_TABLE (table9), id, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (id), "File number");
gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Playing");
gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Artist - Album");
gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Artist");
@@ -2107,7 +2108,7 @@ create_editcolumndlg (void)
gtk_entry_set_invisible_char (GTK_ENTRY (format), 9679);
gtk_entry_set_activates_default (GTK_ENTRY (format), TRUE);
- label25 = gtk_label_new ("Format conversions (start with %):\n [a]rtist, [t]itle, al[b]um, track[n]umber,\n [l]ength, [y]ear, [g]enre, [c]omment, copy[r]ight\nExample: %a - %t [%l]");
+ label25 = gtk_label_new ("Format conversions (start with %):\n [a]rtist, [t]itle, al[b]um, track[n]umber,\n [l]ength, [y]ear, [g]enre, [c]omment,\n copy[r]ight, [f]ilename\nExample: %a - %t [%l]");
gtk_widget_show (label25);
gtk_table_attach (GTK_TABLE (table9), label25, 0, 2, 4, 5,
(GtkAttachOptions) (GTK_FILL),
diff --git a/plugins/notification/Makefile.am b/plugins/notification/Makefile.am
new file mode 100644
index 00000000..5a9f7f65
--- /dev/null
+++ b/plugins/notification/Makefile.am
@@ -0,0 +1,5 @@
+notificationdir = $(libdir)/$(PACKAGE)
+pkglib_LTLIBRARIES = notification.la
+notification_la_SOURCES = notification.c
+notification_la_LDFLAGS = -module
+AM_CFLAGS = -std=c99
diff --git a/plugins/notification/notification.c b/plugins/notification/notification.c
new file mode 100644
index 00000000..dc5b669f
--- /dev/null
+++ b/plugins/notification/notification.c
@@ -0,0 +1,63 @@
+#include "../../deadbeef.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static DB_misc_t plugin;
+static DB_functions_t *deadbeef;
+
+#define DEFAULT_COMMAND "notify-send '%t' '%a - %b'"
+
+static const char settings_dlg[] =
+ "property Command entry notification.command \"" DEFAULT_COMMAND "\";\n"
+;
+
+static void
+show_notification (DB_playItem_t *track)
+{
+ char cmd [1024];
+ deadbeef->pl_format_title (track, -1, cmd, sizeof (cmd), -1, deadbeef->conf_get_str ("notification.command", DEFAULT_COMMAND));
+ //system (cmd);
+}
+
+static int
+songchanged (DB_event_trackchange_t *ev, uintptr_t data) {
+ DB_playItem_t *track = deadbeef->pl_get_for_idx (ev->to);
+ if (track) {
+ show_notification (track);
+ }
+ return 0;
+}
+
+static int
+notification_stop (void) {
+ deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_SONGCHANGED, DB_CALLBACK (songchanged), 0);
+ return 0;
+}
+
+static int
+notification_start (void) {
+ deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_SONGCHANGED, DB_CALLBACK (songchanged), 0);
+ return 0;
+}
+
+DB_plugin_t *
+notification_load (DB_functions_t *api) {
+ deadbeef = api;
+ return DB_PLUGIN (&plugin);
+}
+
+// define plugin interface
+static DB_misc_t plugin = {
+ DB_PLUGIN_SET_API_VERSION
+ .plugin.type = DB_PLUGIN_MISC,
+ .plugin.name = "Current track notification",
+ .plugin.descr = "Displays notification when current track is changed",
+ .plugin.author = "Viktor Semykin",
+ .plugin.email = "thesame.ml@gmail.com",
+ .plugin.website = "http://deadbeef.sf.net",
+ .plugin.start = notification_start,
+ .plugin.stop = notification_stop,
+ .plugin.configdialog = settings_dlg
+};
+
diff --git a/plugins/oss/Makefile.am b/plugins/oss/Makefile.am
index 810bd249..e2195996 100644
--- a/plugins/oss/Makefile.am
+++ b/plugins/oss/Makefile.am
@@ -1,6 +1,6 @@
ossdir = $(libdir)/$(PACKAGE)
pkglib_LTLIBRARIES = oss.la
-AM_CFLAGS = $(CFLAGS) $(OSS4_CFLAGS)
+AM_CFLAGS = $(CFLAGS) $(OSS_CFLAGS) -std=c99
oss_la_SOURCES = oss.c
oss_la_LDFLAGS = -module
diff --git a/plugins/oss/oss.c b/plugins/oss/oss.c
index 11dd52ee..64f857d3 100644
--- a/plugins/oss/oss.c
+++ b/plugins/oss/oss.c
@@ -15,6 +15,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
+# include "../../config.h"
+#endif
#include <stdint.h>
#include <unistd.h>
#ifdef __linux__
@@ -22,16 +25,16 @@
#endif
#include <stdio.h>
#include <string.h>
+#if HAVE_SYS_SOUNDCARD_H
#include <sys/soundcard.h>
+#else
+#include <soundcard.h>
+#endif
#include <fcntl.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include "../../deadbeef.h"
-//#if OSS_VERSION<0x040000
-//#error oss4 plugin: at least oss v4.0 is required to build this plugin
-//#endif
-
#define trace(...) { fprintf(stderr, __VA_ARGS__); }
//#define trace(fmt,...)
@@ -45,6 +48,8 @@ static int state;
static int fd;
static uintptr_t mutex;
+#define BLOCKSIZE 4096
+
static void
oss_thread (void *context);
@@ -68,6 +73,18 @@ oss_init (void) {
return -1;
}
+#if OSS_VERSION>=0x040000
+/*
+ int cooked = 1;
+ ioctl (fd, SNDCTL_DSP_COOKEDMODE, &cooked);
+ trace ("oss: cooked_mode=%d\n", cooked);
+
+ int policy = 3;
+ ioctl (fd, SNDCTL_DSP_POLICY, &policy);
+ trace ("oss: policy=%d\n", policy);
+*/
+#endif
+
int fmt = AFMT_S16_NE;
if (ioctl (fd, SNDCTL_DSP_SETFMT, &fmt) == -1) {
trace ("oss: failed to set format\n");
@@ -157,7 +174,9 @@ oss_free (void) {
static int
oss_play (void) {
if (!oss_tid) {
- oss_init ();
+ if (oss_init () < 0) {
+ return -1;
+ }
}
state = OUTPUT_STATE_PLAYING;
return 0;
@@ -227,8 +246,8 @@ oss_thread (void *context) {
continue;
}
- char buf[1024];
- oss_callback (buf, 1024);
+ char buf[BLOCKSIZE];
+ oss_callback (buf, sizeof (buf));
deadbeef->mutex_lock (mutex);
int res = write (fd, buf, sizeof (buf));
deadbeef->mutex_unlock (mutex);
diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c
index aff400ab..3e7ddefb 100644
--- a/plugins/vorbis/vorbis.c
+++ b/plugins/vorbis/vorbis.c
@@ -434,7 +434,7 @@ vorbis_stop (void) {
return 0;
}
-static const char * exts[] = { "ogg", NULL };
+static const char * exts[] = { "ogg", "ogx", NULL };
static const char *filetypes[] = { "OggVorbis", NULL };
// define plugin interface
diff --git a/streamer.c b/streamer.c
index 38371b77..a196e33a 100644
--- a/streamer.c
+++ b/streamer.c
@@ -308,7 +308,10 @@ streamer_thread (void *ctx) {
else if (pstate == 1) {
last_bitrate = -1;
avg_bitrate = -1;
- p_play ();
+ if (p_play () < 0) {
+ fprintf (stderr, "streamer: failed to start playback; output plugin doesn't work\n");
+ streamer_set_nextsong (-2, 0);
+ }
}
else if (pstate == 2) {
p_pause ();
diff --git a/web/faq.txt b/web/faq.txt
new file mode 100644
index 00000000..906050af
--- /dev/null
+++ b/web/faq.txt
@@ -0,0 +1,59 @@
+A: I have PulseAudio, and I have playback problems (noise, distortion, wrong speed, no sound, etc)
+
+Q: Disable PulseAudio
+
+--
+
+A: I don't get it. Yes, indeed I have PulseAudio, but in Deadbeef I select ALSA output, and I get playback problems.
+
+Q: PulseAudio tricks applications by providing ALSA-plugin that routes sound from application to PulseAudio via ALSA API.
+
+--
+
+A: Is it planned to support PulseAudio natively?
+
+Q: No one works on that right now. You can write the output plugin yourself. Send me the patch, I'll include it in the next release.
+
+--
+
+A: I don't like your tone.
+
+Q: GTFO!
+
+--
+
+A: Is it planned to support multiple playlists and EQ?
+
+Q: Yes
+
+--
+
+A: Is it planned to make Windows and/or OSX ports?
+
+Q: No
+
+--
+
+A: Playlist, settings, etc are not saved if I kill X session, shut down or restart computer, etc
+
+Q: That is not fixed yet. But it is work in progress. Please don't bother me with that unless you have a patch that fixes it.
+
+--
+
+A: Deadbeef takes too much CPU% when playing mp3/ogg/flac.
+
+Q: Try to reduce SRC quality in preferences window
+Q: Try to check "Use software ALSA resampling" box
+Q: See the PulseAudio questions above
+
+--
+
+A: Deadbeef takes too much CPU% when playing APE files.
+
+Q: That's normal. Consider switching to wavpack or flac.
+
+--
+
+A: I have 50 ideas about what features must be added to the player!!!111oneone. Can i become idea-generator of the project, so that I tell, and developers do what I ask for?
+
+Q: No
diff --git a/web/index.html b/web/index.html
index ac54878d..f47a71e4 100644
--- a/web/index.html
+++ b/web/index.html
@@ -34,11 +34,17 @@
font-size: 80%;
margin-bottom: 0.5em;
}
+ #faq {
+ color: #ff0000;
+ font-size: 120%;
+ font-weight: bold;
+ }
</style>
<body>
<ul id='header'>
<li><a href="#news">News</a></li>
<li><a href="#about">About</a></li>
+ <li><a id='faq' href="faq.txt">F.A.Q.</a></li>
<li><a href="#license">Copying</a></li>
<li><a href="#download">Download</a></li>
<li><a href="#bugs">Reporting Bugs</a></li>