Back to project page Media-Pack.
The source code is released under:
Apache License
If you think the Android project Media-Pack listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
// // INTEL CORPORATION PROPRIETARY INFORMATION // This software is supplied under the terms of a license agreement or // nondisclosure agreement with Intel Corporation and may not be copied // or disclosed except in accordance with the terms of that agreement. // Copyright (c) 2013-2014 Intel Corporation. All Rights Reserved. ///*w w w .j av a2 s. co m*/ package com.intel.inde.mp.samples; public class Format { public static String duration(long durationMs) { long duration = durationMs / 1000; long h = duration / 3600; long m = (duration - h * 3600) / 60; long s = duration - (h * 3600 + m * 60); String durationValue; if (h == 0) { durationValue = asTwoDigit(m) + ":" + asTwoDigit(s); } else { durationValue = asTwoDigit(h) + ":" + asTwoDigit(m) + ":" + asTwoDigit(s); } return durationValue; } public static String asTwoDigit(long digit) { String value = ""; if (digit < 10) { value = "0"; } value += String.valueOf(digit); return value; } }