* Minor code simplification.

This commit is contained in:
Justin Maggard 2010-08-28 08:01:51 +00:00
parent da624cedfd
commit 0a1c3a3b17

View File

@ -1771,17 +1771,11 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
if( h->reqflags & FLAG_CAPTION ) if( h->reqflags & FLAG_CAPTION )
{ {
sprintf(sql_buf, "SELECT 1 from CAPTIONS where ID = '%lld'", id); if( sql_get_int_field(db, "SELECT ID from CAPTIONS where ID = '%lld'", id) > 0 )
ret = sql_get_table(db, sql_buf, &result, &rows, NULL);
if( ret == SQLITE_OK )
{ {
if( rows ) sprintf(hdr_buf, "CaptionInfo.sec: http://%s:%d/Captions/%lld.srt\r\n",
{ lan_addr[0].str, runtime_vars.port, id);
sprintf(hdr_buf, "CaptionInfo.sec: http://%s:%d/Captions/%lld.srt\r\n", strcat(header, hdr_buf);
lan_addr[0].str, runtime_vars.port, id);
strcat(header, hdr_buf);
}
sqlite3_free_table(result);
} }
} }