Fix getLastReceivedStatistics method, fixes #139

This commit is contained in:
Taner Sener 2021-09-15 17:35:14 +01:00
parent 64d380290a
commit e3ea69a58e
2 changed files with 2 additions and 2 deletions

View File

@ -157,7 +157,7 @@ public class FFmpegSession extends AbstractSession implements Session {
public Statistics getLastReceivedStatistics() {
synchronized (statisticsLock) {
if (statistics.size() > 0) {
return statistics.get(0);
return statistics.get(statistics.size() - 1);
} else {
return null;
}

View File

@ -116,7 +116,7 @@
[_statisticsLock lock];
if ([_statistics count] > 0) {
lastStatistics = [_statistics objectAtIndex:0];
lastStatistics = [_statistics objectAtIndex:[_statistics count] - 1];
}
[_statisticsLock unlock];