[vlc-commits] commit: lua_http: fix duration printing. ( Rémi Duraffort )

git at videolan.org git at videolan.org
Thu Apr 8 17:41:20 CEST 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Apr  8 17:40:59 2010 +0200| [aa648afd1a957cea4f1119109e10240663397dbc] | committer: Rémi Duraffort 

lua_http: fix duration printing.

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

 share/lua/http/js/functions.js       |    2 +-
 share/lua/http/requests/playlist.xml |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/lua/http/js/functions.js b/share/lua/http/js/functions.js
index fc0ed92..56b6481 100644
--- a/share/lua/http/js/functions.js
+++ b/share/lua/http/js/functions.js
@@ -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' )
diff --git a/share/lua/http/requests/playlist.xml b/share/lua/http/requests/playlist.xml
index 922e149..619fd04 100644
--- a/share/lua/http/requests/playlist.xml
+++ b/share/lua/http/requests/playlist.xml
@@ -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
 



More information about the vlc-commits mailing list