]> git.sesse.net Git - vlc/commitdiff
lua_http: fix duration printing.
authorRémi Duraffort <ivoire@videolan.org>
Thu, 8 Apr 2010 15:40:59 +0000 (17:40 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 8 Apr 2010 15:40:59 +0000 (17:40 +0200)
share/lua/http/js/functions.js
share/lua/http/requests/playlist.xml

index fc0ed9246aaed640fd10df3bc12918f1315a55ee..56b64816b94e6f18b89885f04649ef5bfd0b6bee 100644 (file)
@@ -616,7 +616,7 @@ function parse_playlist()
                     pl.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
                     var duration = elt.getAttribute( 'duration' );
                     if( duration > 0 )
-                        pl.appendChild( document.createTextNode( " (" + format_time( elt.getAttribute( 'duration' ) / 1000000 ) + ")" ) );
+                        pl.appendChild( document.createTextNode( " (" + format_time( elt.getAttribute( 'duration' ) ) + ")" ) );
                     pos.appendChild( pl );
 
                     if( elt.getAttribute( 'ro' ) == 'rw' )
index 922e1492ad0942cf5d298511922c566bb85d99b0..619fd04cfff688c2e68bdbfe85eebeb879f579ae 100644 (file)
@@ -57,7 +57,7 @@ function print_playlist(item)
                 current = 'current="current"'
             end
         end
-        print('<leaf id="' ..tostring(item.id).. '" uri="' ..tostring(path).. '" name="' ..name.. '" ro="' ..(item.flags.ro and "ro" or "rw").. '" duration ="' ..tostring(item.duration).. '" ' ..current.. ' />')
+        print('<leaf id="' ..tostring(item.id).. '" uri="' ..tostring(path).. '" name="' ..name.. '" ro="' ..(item.flags.ro and "ro" or "rw").. '" duration ="' ..math.floor(item.duration).. '" ' ..current.. ' />')
     end
 end