Fix getLastReceivedStatistics method, fixes #139
This commit is contained in:
parent
64d380290a
commit
e3ea69a58e
@ -157,7 +157,7 @@ public class FFmpegSession extends AbstractSession implements Session {
|
|||||||
public Statistics getLastReceivedStatistics() {
|
public Statistics getLastReceivedStatistics() {
|
||||||
synchronized (statisticsLock) {
|
synchronized (statisticsLock) {
|
||||||
if (statistics.size() > 0) {
|
if (statistics.size() > 0) {
|
||||||
return statistics.get(0);
|
return statistics.get(statistics.size() - 1);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
|
|
||||||
[_statisticsLock lock];
|
[_statisticsLock lock];
|
||||||
if ([_statistics count] > 0) {
|
if ([_statistics count] > 0) {
|
||||||
lastStatistics = [_statistics objectAtIndex:0];
|
lastStatistics = [_statistics objectAtIndex:[_statistics count] - 1];
|
||||||
}
|
}
|
||||||
[_statisticsLock unlock];
|
[_statisticsLock unlock];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user