* Fix a couple minor DLNA correctness issues.

This commit is contained in:
Justin Maggard 2011-04-28 23:01:28 +00:00
parent 7068d2fda4
commit e0e0fa254d
4 changed files with 23 additions and 24 deletions

View File

@ -1034,7 +1034,8 @@ GetVideoMetadata(const char * path, char * name)
ts = ctx->priv_data;
if( ts->packet_size == 192 )
{
if( dlna_timestamp_is_present(path) )
if( vc->profile == FF_PROFILE_H264_HIGH ||
dlna_timestamp_is_present(path) )
ts_timestamp = VALID;
else
ts_timestamp = EMPTY;

View File

@ -87,7 +87,6 @@
"http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HP_HD_AC3;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HP_HD_AC3_ISO;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_MP_HD_AAC_MULT5;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_MP_HD_AAC_MULT5_ISO;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
@ -142,15 +141,15 @@
"http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01," \
"http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01," \
"http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01," \
"http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAPRO;DLNA.ORG_OP=01," \
"http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01," \
"http-get:*:audio/3gpp:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01," \
"http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01," \
"http-get:*:audio/mp4:DLNA.ORG_PN=AAC_MULT5_ISO;DLNA.ORG_OP=01," \
"http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01," \
"http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAPRO;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:audio/3gpp:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:audio/mp4:DLNA.ORG_PN=AAC_MULT5_ISO;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_CI=0," \
"http-get:*:image/jpeg:*," \
"http-get:*:video/avi:*," \
"http-get:*:video/divx:*," \

View File

@ -1696,7 +1696,7 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
off_t total, offset, size;
sqlite_int64 id;
int sendfh;
static struct { sqlite_int64 id; char path[PATH_MAX]; char mime[32]; char dlna[64]; } last_file = { 0 };
static struct { sqlite_int64 id; char path[PATH_MAX]; char mime[32]; char dlna[96]; } last_file = { 0 };
#if USE_FORK
pid_t newpid = 0;
#endif

View File

@ -769,13 +769,13 @@ callback(void *args, int argc, char **argv, char **azColName)
passed_args->size += ret;
}
if( artist ) {
if( (*mime == 'a') && (passed_args->filter & FILTER_UPNP_ARTIST) ) {
ret = snprintf(str_buf, 512, "<upnp:artist>%s</upnp:artist>", artist);
if( (*mime == 'v') && (passed_args->filter & FILTER_UPNP_ACTOR) ) {
ret = snprintf(str_buf, 512, "<upnp:actor>%s</upnp:actor>", artist);
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
passed_args->size += ret;
}
else if( (*mime == 'v') && (passed_args->filter & FILTER_UPNP_ACTOR) ) {
ret = snprintf(str_buf, 512, "<upnp:actor>%s</upnp:actor>", artist);
if( passed_args->filter & FILTER_UPNP_ARTIST ) {
ret = snprintf(str_buf, 512, "<upnp:artist>%s</upnp:artist>", artist);
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
passed_args->size += ret;
}
@ -1321,13 +1321,14 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
groupBy[0] = '\0';
if( !SearchCriteria )
{
asprintf(&newSearchCriteria, "1 = 1");
newSearchCriteria = strdup("1 = 1");
SearchCriteria = newSearchCriteria;
}
else
{
SearchCriteria = modifyString(SearchCriteria, """, "\"", 0);
SearchCriteria = modifyString(SearchCriteria, "'", "'", 0);
SearchCriteria = modifyString(SearchCriteria, "\\\"", "\"\"", 0);
SearchCriteria = modifyString(SearchCriteria, "object.", "", 0);
SearchCriteria = modifyString(SearchCriteria, "derivedfrom", "like", 1);
SearchCriteria = modifyString(SearchCriteria, "contains", "like", 2);
@ -1343,16 +1344,14 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
SearchCriteria = modifyString(SearchCriteria, "@refID", "REF_ID", 0);
if( strstr(SearchCriteria, "@id") )
{
newSearchCriteria = modifyString(strdup(SearchCriteria), "@id", "OBJECT_ID", 0);
SearchCriteria = newSearchCriteria;
newSearchCriteria = strdup(SearchCriteria);
newSearchCriteria = SearchCriteria = modifyString(newSearchCriteria, "@id", "OBJECT_ID", 0);
}
if( strstr(SearchCriteria, "res is ") )
{
if( newSearchCriteria )
newSearchCriteria = modifyString(newSearchCriteria, "res is ", "MIME is ", 0);
else
newSearchCriteria = modifyString(strdup(SearchCriteria), "res is ", "MIME is ", 0);
SearchCriteria = newSearchCriteria;
if( !newSearchCriteria )
newSearchCriteria = strdup(SearchCriteria);
newSearchCriteria = SearchCriteria = modifyString(newSearchCriteria, "res is ", "MIME is ", 0);
}
#if 0 // Does 360 need this?
if( strstr(SearchCriteria, "&") )