Merge branch 'master' into libav9

This commit is contained in:
ejurgensen 2014-01-06 21:47:20 +01:00
commit 672885faaf
3 changed files with 26 additions and 27 deletions

11
INSTALL
View File

@ -27,7 +27,7 @@ Libraries:
from <http://avahi.org/> from <http://avahi.org/>
- sqlite3 3.5.0+ with unlock notify API enabled (read below) - sqlite3 3.5.0+ with unlock notify API enabled (read below)
from <http://sqlite.org/download.html> from <http://sqlite.org/download.html>
- libav 0.6+/0.7+ (or ffmpeg 0.5.1+) - libav 0.6.x - 0.8.x (or ffmpeg 0.5.x - 0.10.x)
from <http://libav.org/releases/> from <http://libav.org/releases/>
- libconfuse - libconfuse
from <http://www.nongnu.org/confuse/> from <http://www.nongnu.org/confuse/>
@ -68,14 +68,13 @@ documentation, look for SQLITE_ENABLE_UNLOCK_NOTIFY.
Note about libav (ffmpeg) Note about libav (ffmpeg)
------------------------- -------------------------
libav (ffmpeg) is a central piece of forked-daapd and most other FLOSS libav (or ffmpeg) is a central piece of forked-daapd and most other FLOSS
multimedia applications. The version of libav you use will potentially have a multimedia applications. The version of libav you use will potentially have a
great influence on your experience with forked-daapd. great influence on your experience with forked-daapd.
forked-daapd supports older versions of libav and ffmpeg, but for libav 0.8.x forked-daapd is known to be working with libav 0.8.x, but it also supports older
is known to be working. If you use a new version of libav or ffmpeg you may versions of libav and ffmpeg. Versions of libav/ffmpeg newer than 0.8.x/0.11.x
encounter issues with MP3 files with embedded artwork, as forked-daapd may do not work well with forked-daapd.
classify them as video files.
Building from the git tree Building from the git tree

View File

@ -1495,7 +1495,7 @@ dacp_reply_playstatusupdate(struct evhttp_request *req, struct evbuffer *evbuf,
return; return;
} }
if (reqd_rev == 1) if ((reqd_rev == 0) || (reqd_rev == 1))
{ {
ret = make_playstatusupdate(evbuf); ret = make_playstatusupdate(evbuf);
if (ret < 0) if (ret < 0)

View File

@ -635,14 +635,16 @@ player_queue_make(struct query_params *qp, const char *sort)
} }
static int static int
fetch_first_query_match(const char *query, struct db_media_file_info *dbmfi) find_first_song_id(const char *query)
{ {
struct db_media_file_info dbmfi;
struct query_params qp; struct query_params qp;
uint32_t id; int id;
int ret; int ret;
memset(&qp, 0, sizeof(struct query_params)); memset(&qp, 0, sizeof(struct query_params));
/* We only want the id of the first song */
qp.type = Q_ITEMS; qp.type = Q_ITEMS;
qp.idx_type = I_FIRST; qp.idx_type = I_FIRST;
qp.sort = S_NONE; qp.sort = S_NONE;
@ -664,9 +666,9 @@ fetch_first_query_match(const char *query, struct db_media_file_info *dbmfi)
goto no_query_start; goto no_query_start;
} }
if (((ret = db_query_fetch_file(&qp, dbmfi)) == 0) && (dbmfi->id)) if (((ret = db_query_fetch_file(&qp, &dbmfi)) == 0) && (dbmfi.id))
{ {
ret = safe_atou32(dbmfi->id, &id); ret = safe_atoi32(dbmfi.id, &id);
if (ret < 0) if (ret < 0)
{ {
DPRINTF(E_LOG, L_PLAYER, "Invalid song id in query result!\n"); DPRINTF(E_LOG, L_PLAYER, "Invalid song id in query result!\n");
@ -674,12 +676,12 @@ fetch_first_query_match(const char *query, struct db_media_file_info *dbmfi)
goto no_result; goto no_result;
} }
DPRINTF(E_DBG, L_PLAYER, "Found index song\n"); DPRINTF(E_DBG, L_PLAYER, "Found index song (id %d)\n", id);
ret = 1; ret = 1;
} }
else else
{ {
DPRINTF(E_LOG, L_PLAYER, "No song matches query (num %d): %s\n", qp.results, qp.filter); DPRINTF(E_LOG, L_PLAYER, "No song matches query (results %d): %s\n", qp.results, qp.filter);
goto no_result; goto no_result;
} }
@ -690,8 +692,9 @@ fetch_first_query_match(const char *query, struct db_media_file_info *dbmfi)
no_query_start: no_query_start:
if (qp.filter) if (qp.filter)
free(qp.filter); free(qp.filter);
if (ret == 1) if (ret == 1)
return 0; return id;
else else
return -1; return -1;
} }
@ -701,21 +704,20 @@ fetch_first_query_match(const char *query, struct db_media_file_info *dbmfi)
int int
player_queue_make_daap(struct player_source **head, const char *query, const char *queuefilter, const char *sort, int quirk) player_queue_make_daap(struct player_source **head, const char *query, const char *queuefilter, const char *sort, int quirk)
{ {
struct media_file_info *mfi;
struct query_params qp; struct query_params qp;
struct player_source *ps; struct player_source *ps;
struct db_media_file_info dbmfi;
uint32_t id;
int64_t albumid; int64_t albumid;
int plid; int plid;
int id;
int idx; int idx;
int ret; int ret;
int len; int len;
char *s; char *s;
char buf[1024]; char buf[1024];
/* If query doesn't give even a single result give up */ id = find_first_song_id(query);
ret = fetch_first_query_match(query, &dbmfi); if (id < 0)
if (ret < 0)
return -1; return -1;
memset(&qp, 0, sizeof(struct query_params)); memset(&qp, 0, sizeof(struct query_params));
@ -724,22 +726,19 @@ player_queue_make_daap(struct player_source **head, const char *query, const cha
qp.limit = 0; qp.limit = 0;
qp.sort = S_NONE; qp.sort = S_NONE;
id = 0; if (quirk)
if (quirk && dbmfi.album_artist)
{ {
safe_atou32(dbmfi.id, &id);
qp.sort = S_ALBUM; qp.sort = S_ALBUM;
qp.type = Q_ITEMS; qp.type = Q_ITEMS;
s = db_escape_string(dbmfi.album_artist); mfi = db_file_fetch_byid(id);
if (!s) if (!mfi)
return -1; return -1;
snprintf(buf, sizeof(buf), "f.album_artist = '%s'", s); snprintf(buf, sizeof(buf), "f.songartistid = %" PRIi64, mfi->songartistid);
free_mfi(mfi, 0);
qp.filter = strdup(buf); qp.filter = strdup(buf);
} }
else if (queuefilter) else if (queuefilter)
{ {
safe_atou32(dbmfi.id, &id);
len = strlen(queuefilter); len = strlen(queuefilter);
if ((len > 6) && (strncmp(queuefilter, "album:", 6) == 0)) if ((len > 6) && (strncmp(queuefilter, "album:", 6) == 0))
{ {
@ -785,6 +784,7 @@ player_queue_make_daap(struct player_source **head, const char *query, const cha
} }
else else
{ {
id = 0;
qp.type = Q_ITEMS; qp.type = Q_ITEMS;
qp.filter = daap_query_parse_sql(query); qp.filter = daap_query_parse_sql(query);
} }