From b5008ded8d71aa2ecc63a0800fcb54dba85794ba Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Sun, 5 Nov 2006 22:38:12 +0000 Subject: [PATCH] reverse default in follow_symlink option, fix some warnings in plugin.c, fix errors in update as result of new db fields --- src/db-sql.c | 2 +- src/ff-plugins.h | 2 +- src/mp3-scanner.c | 2 +- src/plugin.c | 14 +++++++++----- src/plugin.h | 2 -- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/db-sql.c b/src/db-sql.c index 3793e7f9..103106e1 100644 --- a/src/db-sql.c +++ b/src/db-sql.c @@ -965,7 +965,7 @@ int db_sql_update(char **pe, MP3FILE *pmp3, int *id) { "rating=%d," // rating "sample_count=%s," // sample_count "codectype='%q'," // codec - "album_artist='%q'," + "album_artist='%q'" " WHERE path='%q' and idx=%d"); path = _db_proper_path(pmp3->path); diff --git a/src/ff-plugins.h b/src/ff-plugins.h index 95f461bf..ea6587fd 100644 --- a/src/ff-plugins.h +++ b/src/ff-plugins.h @@ -157,7 +157,7 @@ typedef struct tag_plugin_input_fn { void (*conf_dispose_string)(char *str); int (*conf_get_int)(char *section, char *key, int dflt); - int (*config_set_status)(struct tag_ws_conninfo *pwsc, int session, char *fmt, ...); + void (*config_set_status)(struct tag_ws_conninfo *pwsc, int session, char *fmt, ...); } PLUGIN_INPUT_FN; diff --git a/src/mp3-scanner.c b/src/mp3-scanner.c index f204b809..5c4eb553 100644 --- a/src/mp3-scanner.c +++ b/src/mp3-scanner.c @@ -334,7 +334,7 @@ int scan_path(char *path) { int is_compdir; int follow_symlinks = 0; - follow_symlinks = conf_get_int("scanning","follow_symlinks",0); + follow_symlinks = conf_get_int("scanning","follow_symlinks",1); extensions = conf_alloc_string("general","extensions",".mp3,.m4a,.m4p"); if((current_dir=opendir(path)) == NULL) { diff --git a/src/plugin.c b/src/plugin.c index 7c1ee3ce..a1f27525 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -80,6 +80,7 @@ void _plugin_unlock(void); int _plugin_error(char **pe, int error, ...); void _plugin_free(int *pi); void _plugin_recalc_codecs(void); +int _plugin_ssc_transcode(WS_CONNINFO *pwsc, char *file, char *codec, int duration, int offset, int headers); /* webserver helpers */ char *pi_ws_uri(WS_CONNINFO *pwsc); @@ -103,6 +104,9 @@ int pi_db_count_items(int what); int pi_db_wait_update(WS_CONNINFO *pwsc); void pi_conf_dispose_string(char *str); +/* transcode helpers */ +int pi_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec); + PLUGIN_INPUT_FN pi = { pi_ws_uri, pi_ws_will_close, @@ -118,7 +122,7 @@ PLUGIN_INPUT_FN pi = { pi_server_ver, pi_server_name, pi_log, - plugin_ssc_should_transcode, + pi_ssc_should_transcode, pi_db_count, pi_db_enum_start, @@ -448,7 +452,7 @@ void plugin_event_dispatch(int event_id, int intval, void *vp, int len) { * @param codec the codec we are trying to serve * @returns TRUE if we can transcode, FALSE otherwise */ -int plugin_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec) { +int pi_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec) { int result; char *native_codecs=NULL; char *user_agent=NULL; @@ -549,7 +553,7 @@ int _plugin_ssc_copy(WS_CONNINFO *pwsc, PLUGIN_TRANSCODE_FN *pfn, * @param duration time in ms * @returns bytes transferred, or -1 on error */ -int plugin_ssc_transcode(WS_CONNINFO *pwsc, char *file, char *codec, int duration, int offset, int headers) { +int _plugin_ssc_transcode(WS_CONNINFO *pwsc, char *file, char *codec, int duration, int offset, int headers) { PLUGIN_ENTRY *ppi, *ptc=NULL; PLUGIN_TRANSCODE_FN *pfn = NULL; void *vp_ssc; @@ -849,7 +853,7 @@ void pi_stream(WS_CONNINFO *pwsc, char *id) { DPRINTF(E_LOG,L_DAAP|L_WS|L_DB,"Could not find requested item %lu\n",item); config_set_status(pwsc,session,NULL); ws_returnerror(pwsc,404,"File Not Found"); - } else if (plugin_ssc_should_transcode(pwsc,pmp3->codectype)) { + } else if (pi_ssc_should_transcode(pwsc,pmp3->codectype)) { /************************ * Server side conversion ************************/ @@ -861,7 +865,7 @@ void pi_stream(WS_CONNINFO *pwsc, char *id) { "Session %d: Streaming file '%s' to %s (offset %ld)\n", session,pmp3->fname, pwsc->hostname,(long)offset); - bytes_copied = plugin_ssc_transcode(pwsc,pmp3->path,pmp3->codectype, + bytes_copied = _plugin_ssc_transcode(pwsc,pmp3->path,pmp3->codectype, pmp3->song_length,offset,1); config_set_status(pwsc,session,NULL); diff --git a/src/plugin.h b/src/plugin.h index 19a50129..4199bf5c 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -38,8 +38,6 @@ extern int plugin_rend_register(char *name, int port, char *iface, char *txt); extern void plugin_event_dispatch(int event_id, int intval, void *vp, int len); /* these should really get rows */ -extern int plugin_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec); -extern int plugin_ssc_transcode(WS_CONNINFO *pwsc, char *file, char *codec, int duration, int offset, int headers); #define PLUGIN_E_SUCCESS 0 #define PLUGIN_E_NOLOAD 1