Skip to content

Commit

Permalink
Fix getLastReceivedStatistics method, fixes #139
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed Sep 15, 2021
1 parent 64d3802 commit e3ea69a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public List<Statistics> getStatistics() {
public Statistics getLastReceivedStatistics() {
synchronized (statisticsLock) {
if (statistics.size() > 0) {
return statistics.get(0);
return statistics.get(statistics.size() - 1);
} else {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion apple/src/FFmpegSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ - (Statistics*)getLastReceivedStatistics {

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

Expand Down

0 comments on commit e3ea69a

Please sign in to comment.