Skip to content
Permalink
Browse files
8266860: [macos] Incorrect duration reported for HLS live streams
Reviewed-by: kcr
  • Loading branch information
Alexander Matveev committed May 18, 2021
1 parent d2d145d commit c511789b106a3f3172aef606419d372bcbca606f
Showing with 5 additions and 2 deletions.
  1. +5 −2 modules/javafx.media/src/main/native/jfxmedia/platform/osx/avf/AVFMediaPlayer.mm
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -377,7 +377,10 @@ - (void) setRate:(float)rate {

- (double) duration {
if (self.player.currentItem.status == AVPlayerItemStatusReadyToPlay) {
return CMTimeGetSeconds(self.player.currentItem.duration);
CMTime dur = self.player.currentItem.duration;
if (!CMTIME_IS_INDEFINITE(dur)) {
return CMTimeGetSeconds(self.player.currentItem.duration);
}
}
return -1.0;
}

2 comments on commit c511789

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot replied May 18, 2021

@swpalmer

This comment has been minimized.

Copy link
Collaborator

@swpalmer swpalmer replied Sep 14, 2021

Was the intention to re-use the 'dur' variable on the return line?

Please sign in to comment.