[vlc-commits] UPNP SD: comply to upnp specification wrt to res:duration.

Konstantin Pavlov git at videolan.org
Thu Dec 27 09:46:16 CET 2012


vlc | branch: master | Konstantin Pavlov <thresh at videolan.org> | Thu Dec 27 12:42:10 2012 +0400| [0e6418ec4cc7cbf0527c26216096c88196a05cc1] | committer: Konstantin Pavlov

UPNP SD: comply to upnp specification wrt to res:duration.

Also, omit fraction of seconds.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e6418ec4cc7cbf0527c26216096c88196a05cc1
---

 modules/services_discovery/upnp.cpp |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index c69f0ef..4dbcf1f 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -891,12 +891,11 @@ bool MediaServer::_fetchContents( Container* p_parent, int i_offset )
 
                     if ( psz_duration )
                     {
-                        if( sscanf( psz_duration, "%02d:%02d:%02d.%d",
+                        if( sscanf( psz_duration, "%d:%02d:%02d",
                             &i_hours, &i_minutes, &i_seconds, &i_decis ))
                             i_duration = INT64_C(1000000) * ( i_hours*3600 +
                                                               i_minutes*60 +
-                                                              i_seconds ) +
-                                         INT64_C(100000) * i_decis;
+                                                              i_seconds );
                     }
                     Item* item = new Item( p_parent, objectID, title, psz_resource_url, i_duration );
                     p_parent->addItem( item );



More information about the vlc-commits mailing list