1 From f65143c87c8d35e26b0876e9789c47b2dddaaf12 Mon Sep 17 00:00:00 2001
2 From: Justin Maggard <jmaggard@netgear.com>
3 Date: Wed, 17 May 2017 14:11:44 -0700
4 Subject: [PATCH] platinum: Fix upnp:lastPlaybackPosition parsing
6 According to the UPnP spec, upnp:lastPlaybackPosition should use the
7 same format as duration (HH:MM:SS). So we should at least accept the
8 proper format if it exists, and fall back to the raw integer value if
9 it's not in the proper format.
11 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp | 5 ++++-
12 1 file changed, 4 insertions(+), 1 deletion(-)
14 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
15 index 5324dcb0e4..fac16902f7 100644
16 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
17 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
18 @@ -762,7 +762,10 @@ PLT_MediaObject::FromDidl(NPT_XmlElementNode* entry)
19 m_MiscInfo.original_track_number = value;
21 PLT_XmlHelper::GetChildText(entry, "lastPlaybackPosition", str, didl_namespace_upnp);
22 - if (NPT_FAILED(str.ToInteger(value))) value = 0;
23 + if (NPT_FAILED(PLT_Didl::ParseTimeStamp(str, value))) {
24 + // fall back to raw integer parsing
25 + if (NPT_FAILED(str.ToInteger(value))) value = 0;
27 m_MiscInfo.last_position = value;
29 PLT_XmlHelper::GetChildText(entry, "lastPlaybackTime", m_MiscInfo.last_time, didl_namespace_upnp, 256);