From 542c60c30b82b62d74de71dc2ed9d071835c97c4 Mon Sep 17 00:00:00 2001 From: Jerry Russell Date: Thu, 16 Nov 2017 00:38:44 +0000 Subject: [PATCH] issue 349 - add missing code to allow preview seek --- airtime_mvc/application/common/FileIO.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/common/FileIO.php b/airtime_mvc/application/common/FileIO.php index 96cc73878..600a364ae 100644 --- a/airtime_mvc/application/common/FileIO.php +++ b/airtime_mvc/application/common/FileIO.php @@ -70,11 +70,17 @@ class Application_Common_FileIO ob_end_flush(); } - // NOTE: We can't use fseek here because it does not work with streams - // (a.k.a. Files stored in the cloud) - while(!feof($fm) && (connection_status() == 0)) { + + //These two lines were removed from Airtime 2.5.x at some point after Libretime forked from Airtime. + //These lines allow seek to work for files. + //Issue #349 + $cur = $begin; + fseek($fm,$begin,0); + + + while(!feof($fm) && (connection_status() == 0) && ($cur <= $end)) { echo fread($fm, 1024 * 8); } fclose($fm); } -} \ No newline at end of file +}