|
YAACC - UPNP Client and Server
|
The estimate behind the server-side time range management for renderers that cannot seek themselves: from a playback time to a byte position of the file. More...

Static Public Member Functions | |
| static long | bytePositionForTime (long totalSize, long timeMs, long totalDurationMs) |
| static long | estimateDurationMs (long totalSize) |
Guesses the duration of a file from its size at 128 kbit/s: size * 8 * 1000 / (128 * 1024), computed without overflow. | |
The estimate behind the server-side time range management for renderers that cannot seek themselves: from a playback time to a byte position of the file.
Plain Java, long/double arithmetic that cannot overflow; every result is inside the file.
The formula is the one of the original implementation: the first 10 percent of the file are treated as header/metadata, the playback time is spread over the remaining 90 percent, and the result never goes beyond 85 percent of the file. The duration is guessed from the file size assuming 128 kbit/s.
|
static |
| totalSize | size of the file in bytes; <= 0 means unknown |
| timeMs | playback time in milliseconds |
| totalDurationMs | duration in milliseconds; <= 0 means unknown |
Referenced by de.yaacc.share.ServerSideSeeking.plan().

|
static |
Guesses the duration of a file from its size at 128 kbit/s: size * 8 * 1000 / (128 * 1024), computed without overflow.
Referenced by de.yaacc.share.ServerSideSeeking.plan().
