From 8dc1a82d7e04d93182dc4218710cd93a593c42fd Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Wed, 3 Jun 2009 22:01:31 +0000 Subject: [PATCH] * Use PS3-style MIME tweaks for Samsung TVs. --- upnphttp.c | 4 ++++ upnphttp.h | 2 ++ upnpsoap.c | 31 ++++++++++++++----------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/upnphttp.c b/upnphttp.c index c50f88f..15c4d39 100644 --- a/upnphttp.c +++ b/upnphttp.c @@ -226,16 +226,19 @@ intervening space) by either an integer or the keyword "infinite". */ if(strncasecmp(p, "Xbox/", 5)==0) { h->req_client = EXbox; + h->reqflags |= FLAG_MIME_AVI_AVI; } else if(strncmp(p, "PLAYSTATION", 11)==0) { h->req_client = EPS3; h->reqflags |= FLAG_DLNA; + h->reqflags |= FLAG_MIME_AVI_DIVX; } else if(strncmp(p, "SamsungWiselinkPro", 18)==0) { h->req_client = ESamsungTV; h->reqflags |= FLAG_DLNA; + h->reqflags |= FLAG_MIME_AVI_DIVX; } else if(strcasestr(p, "DLNADOC/1.50")) { @@ -259,6 +262,7 @@ intervening space) by either an integer or the keyword "infinite". */ { h->req_client = EPS3; h->reqflags |= FLAG_DLNA; + h->reqflags |= FLAG_MIME_AVI_DIVX; } } else if(strncasecmp(line, "Transfer-Encoding", 17)==0) diff --git a/upnphttp.h b/upnphttp.h index 1b1b331..41f97e8 100644 --- a/upnphttp.h +++ b/upnphttp.h @@ -82,6 +82,8 @@ struct upnphttp { #define FLAG_XFERBACKGROUND 0x00004000 #define FLAG_DLNA 0x00100000 +#define FLAG_MIME_AVI_DIVX 0x00200000 +#define FLAG_MIME_AVI_AVI 0x00400000 /* New_upnphttp() */ struct upnphttp * diff --git a/upnpsoap.c b/upnpsoap.c index 3447a97..6fe52a8 100644 --- a/upnpsoap.c +++ b/upnpsoap.c @@ -516,25 +516,22 @@ callback(void *args, int argc, char **argv, char **azColName) /* We may need special handling for certain MIME types */ if( *mime == 'v' ) { - switch( passed_args->client ) + if( passed_args->flags & FLAG_MIME_AVI_DIVX ) { - case EPS3: - if( strcmp(mime, "video/x-msvideo") == 0 ) - { - if( creator ) - strcpy(mime+6, "divx"); - else - strcpy(mime+6, "avi"); - } - break; - case EXbox: - if( strcmp(mime, "video/x-msvideo") == 0 ) - { + if( strcmp(mime, "video/x-msvideo") == 0 ) + { + if( creator ) + strcpy(mime+6, "divx"); + else strcpy(mime+6, "avi"); - } - break; - default: - break; + } + } + else if( passed_args->flags & FLAG_MIME_AVI_AVI ) + { + if( strcmp(mime, "video/x-msvideo") == 0 ) + { + strcpy(mime+6, "avi"); + } } if( !(passed_args->flags & FLAG_DLNA) ) {