OSDN Git Service

HLS: Fixed rounding error with decimal segment duration
authorOscar Rydhé <oscar.rydhe@sonymobile.com>
Tue, 17 Dec 2013 08:53:18 +0000 (09:53 +0100)
committerTakeshi Aimi <takeshi.aimi@sonymobile.com>
Thu, 19 Dec 2013 04:48:04 +0000 (13:48 +0900)
If segment duration is specified with decimal value only the
integer value will be used, causing the stream duration to
be wrong.

Reported to Android public issue tracker:
https://code.google.com/p/android/issues/detail?id=56223

Change-Id: I34fb7a81af6ad3d9a214228cfe3724636ebf5ab5

media/libstagefright/httplive/M3UParser.cpp

index 243888c..dd248cb 100644 (file)
@@ -608,7 +608,7 @@ status_t M3UParser::parseMetaDataDuration(
     if (meta->get() == NULL) {
         *meta = new AMessage;
     }
-    (*meta)->setInt64(key, (int64_t)x * 1E6);
+    (*meta)->setInt64(key, (int64_t)(x * 1E6));
 
     return OK;
 }