Skip to content
Permalink
Browse files
8266860: [macos] Incorrect duration reported for HLS live streams
Backport-of: c511789b106a3f3172aef606419d372bcbca606f
  • Loading branch information
arapte committed Aug 19, 2021
1 parent b2c1622 commit 097780df729f4ae9b5bff48f97e4c1323627317b
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;
}

1 comment on commit 097780d

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 097780d Aug 19, 2021

Please sign in to comment.