upnpsoap: Only return sec:dcmInfo with a bookmark
There's no point in returning bookmark info without a bookmark. It also has been reported that certain Samsung models may have issues with subtitles if we send dcmInfo data. So we'll only return it if we have a bookmark set. [minidlna:support-requests] #52 External srt subtitles for Samsung UA48JU7800
This commit is contained in:
parent
9bb6cf5051
commit
4c4485d225
18
upnpsoap.c
18
upnpsoap.c
@ -99,8 +99,9 @@
|
|||||||
* 800-899 TBD Action-specific errors for non-standard actions.
|
* 800-899 TBD Action-specific errors for non-standard actions.
|
||||||
* Defined by UPnP vendor.
|
* Defined by UPnP vendor.
|
||||||
*/
|
*/
|
||||||
|
#define SoapError(x,y,z) _SoapError(x,y,z,__func__)
|
||||||
static void
|
static void
|
||||||
SoapError(struct upnphttp * h, int errCode, const char * errDesc)
|
_SoapError(struct upnphttp * h, int errCode, const char * errDesc, const char *func)
|
||||||
{
|
{
|
||||||
static const char resp[] =
|
static const char resp[] =
|
||||||
"<s:Envelope "
|
"<s:Envelope "
|
||||||
@ -123,7 +124,7 @@ SoapError(struct upnphttp * h, int errCode, const char * errDesc)
|
|||||||
char body[2048];
|
char body[2048];
|
||||||
int bodylen;
|
int bodylen;
|
||||||
|
|
||||||
DPRINTF(E_WARN, L_HTTP, "Returning UPnPError %d: %s\n", errCode, errDesc);
|
DPRINTF(E_WARN, L_HTTP, "%s Returning UPnPError %d: %s\n", func, errCode, errDesc);
|
||||||
bodylen = snprintf(body, sizeof(body), resp, errCode, errDesc);
|
bodylen = snprintf(body, sizeof(body), resp, errCode, errDesc);
|
||||||
BuildResp2_upnphttp(h, 500, "Internal Server Error", body, bodylen);
|
BuildResp2_upnphttp(h, 500, "Internal Server Error", body, bodylen);
|
||||||
SendResp_upnphttp(h);
|
SendResp_upnphttp(h);
|
||||||
@ -1017,17 +1018,18 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
if( (passed_args->filter & FILTER_BOOKMARK_MASK) ) {
|
if( (passed_args->filter & FILTER_BOOKMARK_MASK) ) {
|
||||||
/* Get bookmark */
|
/* Get bookmark */
|
||||||
int sec = sql_get_int_field(db, "SELECT SEC from BOOKMARKS where ID = '%s'", detailID);
|
int sec = sql_get_int_field(db, "SELECT SEC from BOOKMARKS where ID = '%s'", detailID);
|
||||||
if( sec > 0 && (passed_args->filter & FILTER_UPNP_LASTPLAYBACKPOSITION) ) {
|
if( sec > 0 ) {
|
||||||
/* This format is wrong according to the UPnP/AV spec. It should be in duration format,
|
/* This format is wrong according to the UPnP/AV spec. It should be in duration format,
|
||||||
** so HH:MM:SS. But Kodi seems to be the only user of this tag, and it only works with a
|
** so HH:MM:SS. But Kodi seems to be the only user of this tag, and it only works with a
|
||||||
** raw seconds value.
|
** raw seconds value.
|
||||||
** If Kodi gets fixed, we can use duration_str(sec * 1000) here */
|
** If Kodi gets fixed, we can use duration_str(sec * 1000) here */
|
||||||
ret = strcatf(str, "<upnp:lastPlaybackPosition>%d</upnp:lastPlaybackPosition>",
|
if( passed_args->filter & FILTER_UPNP_LASTPLAYBACKPOSITION )
|
||||||
sec);
|
ret = strcatf(str, "<upnp:lastPlaybackPosition>%d</upnp:lastPlaybackPosition>",
|
||||||
|
sec);
|
||||||
|
if( passed_args->filter & FILTER_SEC_DCM_INFO )
|
||||||
|
ret = strcatf(str, "<sec:dcmInfo>CREATIONDATE=0,FOLDER=%s,BM=%d</sec:dcmInfo>",
|
||||||
|
title, sec);
|
||||||
}
|
}
|
||||||
if( passed_args->filter & FILTER_SEC_DCM_INFO )
|
|
||||||
ret = strcatf(str, "<sec:dcmInfo>CREATIONDATE=0,FOLDER=%s,BM=%d</sec:dcmInfo>",
|
|
||||||
title, sec);
|
|
||||||
if( passed_args->filter & FILTER_UPNP_PLAYBACKCOUNT ) {
|
if( passed_args->filter & FILTER_UPNP_PLAYBACKCOUNT ) {
|
||||||
ret = strcatf(str, "<upnp:playbackCount>%d</upnp:playbackCount>",
|
ret = strcatf(str, "<upnp:playbackCount>%d</upnp:playbackCount>",
|
||||||
sql_get_int_field(db, "SELECT WATCH_COUNT from BOOKMARKS where ID = '%s'", detailID));
|
sql_get_int_field(db, "SELECT WATCH_COUNT from BOOKMARKS where ID = '%s'", detailID));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user