Fix sample rate and bitrate for rsp and daap, fixing #134

This commit is contained in:
Ron Pedde 2006-06-03 09:17:17 +00:00
parent 5a9ecc0191
commit 23e5a964d5
2 changed files with 6 additions and 4 deletions

View File

@ -1559,7 +1559,7 @@ int db_sql_build_dmap(DBQUERYINFO *pinfo, char **valarray, unsigned char *presul
if(valarray[15]) samplerate=atoi(valarray[15]); if(valarray[15]) samplerate=atoi(valarray[15]);
if(samplerate) { if(samplerate) {
current += db_dmap_add_short(current,"asbr", current += db_dmap_add_short(current,"asbr",
(short)(samplerate * 4 * 8)/1000); (short)(samplerate / 250 * 8));
} }
} else { } else {
current += db_dmap_add_short(current,"asbr",(short)atoi(valarray[14])); current += db_dmap_add_short(current,"asbr",(short)atoi(valarray[14]));

View File

@ -360,7 +360,7 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
char *browse_type; char *browse_type;
int type; int type;
int transcode; int transcode;
int samplerate; unsigned int samplerate;
ppi->dq.filter = _ppi->ws_getvar(pwsc,"query"); ppi->dq.filter = _ppi->ws_getvar(pwsc,"query");
ppi->dq.filter_type = FILTER_TYPE_FIREFLY; 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", xml_output(pxml,rsp_fields[rowindex].name,"%s",
"wav audio file"); "wav audio file");
break; break;
case 15: case 14: /* bitrate */
samplerate = atoi(row[15]); samplerate = atoi(row[15]);
if(samplerate) { if(samplerate) {
samplerate = (samplerate * 4 * 8)/1000; samplerate = (samplerate * 8) / 250;
} else {
samplerate = 1411;
} }
xml_output(pxml,rsp_fields[rowindex].name,"%d", xml_output(pxml,rsp_fields[rowindex].name,"%d",
samplerate); samplerate);