Fix sample rate and bitrate for rsp and daap, fixing #134
This commit is contained in:
parent
5a9ecc0191
commit
23e5a964d5
|
@ -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]));
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue