diff --git a/src/db-sql.c b/src/db-sql.c index e31c6fc3..f0a24e3d 100644 --- a/src/db-sql.c +++ b/src/db-sql.c @@ -1559,7 +1559,7 @@ int db_sql_build_dmap(DBQUERYINFO *pinfo, char **valarray, unsigned char *presul if(valarray[15]) samplerate=atoi(valarray[15]); if(samplerate) { current += db_dmap_add_short(current,"asbr", - (short)(samplerate * 4 * 8)/1000); + (short)(samplerate / 250 * 8)); } } else { current += db_dmap_add_short(current,"asbr",(short)atoi(valarray[14])); diff --git a/src/plugins/rsp.c b/src/plugins/rsp.c index d47d67ff..fa1dcd99 100644 --- a/src/plugins/rsp.c +++ b/src/plugins/rsp.c @@ -360,7 +360,7 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) { char *browse_type; int type; int transcode; - int samplerate; + unsigned int samplerate; ppi->dq.filter = _ppi->ws_getvar(pwsc,"query"); ppi->dq.filter_type = FILTER_TYPE_FIREFLY; @@ -436,10 +436,12 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) { xml_output(pxml,rsp_fields[rowindex].name,"%s", "wav audio file"); break; - case 15: + case 14: /* bitrate */ samplerate = atoi(row[15]); if(samplerate) { - samplerate = (samplerate * 4 * 8)/1000; + samplerate = (samplerate * 8) / 250; + } else { + samplerate = 1411; } xml_output(pxml,rsp_fields[rowindex].name,"%d", samplerate);