From 0505db94e7278b2b7b2eeca3b30259e1e078d7c3 Mon Sep 17 00:00:00 2001 From: Nayan Savla Date: Tue, 3 Mar 2020 09:49:45 -0800 Subject: [PATCH] Flushing the Buffer flushing the buffer if it gets full, there is an append error which causes freeze issues. --- src/controller/buffer-controller.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controller/buffer-controller.js b/src/controller/buffer-controller.js index eb6b006faa1..93e37adb53a 100644 --- a/src/controller/buffer-controller.js +++ b/src/controller/buffer-controller.js @@ -534,6 +534,7 @@ class BufferController extends EventHandler { } catch (err) { // in case any error occured while appending, put back segment in segments table logger.error(`error while trying to append buffer:${err.message}`); + this.doFlush(); //We flush the buffer to recover from playback freeze issues. segments.unshift(segment); let event = { type: ErrorTypes.MEDIA_ERROR, parent: segment.parent }; if (err.code !== 22) {