* Fix a couple bugs in client detection code.

* Fix incremental UPnPBrowse bug that was recently introduced.
This commit is contained in:
Justin Maggard
2009-05-02 20:53:24 +00:00
parent b947187035
commit 0fa5f5b598
2 changed files with 29 additions and 6 deletions

View File

@ -452,11 +452,14 @@ callback(void *args, int argc, char **argv, char **azColName)
switch( passed_args->client )
{
case EPS3:
if( creator && (strcmp(mime, "video/x-msvideo") == 0) )
if( strcmp(mime, "video/x-msvideo") == 0 )
{
strcpy(mime+6, "divx");
break;
if( creator )
strcpy(mime+6, "divx");
else
strcpy(mime+6, "avi");
}
break;
case EXbox:
if( strcmp(mime, "video/x-msvideo") == 0 )
{
@ -751,7 +754,7 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
ObjectId, RequestedCount, StartingIndex,
BrowseFlag, Filter, SortCriteria);
if( strcmp(BrowseFlag, "BrowseMetadata") == 0 )
if( BrowseFlag && (strcmp(BrowseFlag, "BrowseMetadata") == 0) )
{
args.requested = 1;
sql = sqlite3_mprintf( SELECT_COLUMNS
@ -780,7 +783,6 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
ObjectId, orderBy, StartingIndex, RequestedCount);
DPRINTF(E_DEBUG, L_HTTP, "Browse SQL: %s\n", sql);
ret = sqlite3_exec(db, sql, callback, (void *) &args, &zErrMsg);
totalMatches = args.returned;
}
sqlite3_free(sql);
if( ret != SQLITE_OK )