mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
Fix crash with no location in iTunes xml
This commit is contained in:
parent
916ad55eb5
commit
ca259e8e12
@ -429,7 +429,13 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
|
|||||||
|
|
||||||
_ppi->log(E_DBG,"Transcode: %d, %s: %s\n",transcode,row[37],row[2]);
|
_ppi->log(E_DBG,"Transcode: %d, %s: %s\n",transcode,row[37],row[2]);
|
||||||
|
|
||||||
|
|
||||||
while(rsp_fields[rowindex].name) {
|
while(rsp_fields[rowindex].name) {
|
||||||
|
/* dummy up codectype for streaming radio */
|
||||||
|
if((strcmp(row[27],"1") == 0)&&(rowindex == 37)) {
|
||||||
|
xml_output(pxml,rsp_fields[rowindex].name,"mpeg");
|
||||||
|
} /* count on the fact that codectype is otherwise null */
|
||||||
|
|
||||||
if((rsp_fields[rowindex].flags & type) &&
|
if((rsp_fields[rowindex].flags & type) &&
|
||||||
(row[rowindex] && strlen(row[rowindex]))) {
|
(row[rowindex] && strlen(row[rowindex]))) {
|
||||||
if(transcode) {
|
if(transcode) {
|
||||||
|
@ -182,13 +182,15 @@ int scan_xml_translate_path(char *pold, char *pnew) {
|
|||||||
static int discard;
|
static int discard;
|
||||||
char base_path[PATH_MAX];
|
char base_path[PATH_MAX];
|
||||||
char working_path[PATH_MAX];
|
char working_path[PATH_MAX];
|
||||||
char *current = pold + strlen(pold);
|
char *current;
|
||||||
char *pbase;
|
char *pbase;
|
||||||
char *ptemp;
|
char *ptemp;
|
||||||
|
|
||||||
if((!pold)||(!strlen(pold)))
|
if((!pold)||(!strlen(pold)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
current = pold + strlen(pold);
|
||||||
|
|
||||||
/* see if it's a valid out-of-root path */
|
/* see if it's a valid out-of-root path */
|
||||||
if(strncmp(pold,"file://localhost/",17)==0) {
|
if(strncmp(pold,"file://localhost/",17)==0) {
|
||||||
/* it's a local path.. is it a valid one? */
|
/* it's a local path.. is it a valid one? */
|
||||||
@ -678,7 +680,7 @@ int scan_xml_tracks_section(int action, char *info) {
|
|||||||
state = XML_TRACK_ST_MAIN_DICT;
|
state = XML_TRACK_ST_MAIN_DICT;
|
||||||
/* but more importantly, we gotta process the track */
|
/* but more importantly, we gotta process the track */
|
||||||
is_streaming = 0;
|
is_streaming = 0;
|
||||||
if(strncasecmp(song_path,"http://",7) == 0)
|
if((song_path) && strncasecmp(song_path,"http://",7) == 0)
|
||||||
is_streaming = 1;
|
is_streaming = 1;
|
||||||
|
|
||||||
if((!is_streaming)&&scan_xml_translate_path(song_path,real_path)) {
|
if((!is_streaming)&&scan_xml_translate_path(song_path,real_path)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user