[x265] [PATCH] input: If Any error in reading frame from file, deactivate the thread and exit encoder gracefully

Gopu Govindaswamy gopu at multicorewareinc.com
Thu Oct 24 14:04:56 CEST 2013


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1382616286 -19800
# Node ID 3a4864ff4357af1c342af26c9a8dca8d46b30600
# Parent  7443339bdc9b3bf10dd159ce01468b1cd2f61b6a
input: If Any error in reading frame from file, deactivate the thread and exit encoder gracefully

diff -r 7443339bdc9b -r 3a4864ff4357 source/input/y4m.cpp
--- a/source/input/y4m.cpp	Thu Oct 24 14:30:25 2013 +0530
+++ b/source/input/y4m.cpp	Thu Oct 24 17:34:46 2013 +0530
@@ -307,8 +307,13 @@
 
     ifs.read(buf[tail], count);
     frameStat[tail] = ifs.good();
+
     if (!frameStat[tail])
+    {
+        x265_log(NULL, X265_LOG_ERROR, "y4m: error in frame reading from file");
+        threadActive = false;
         return false;
+    }
     tail = (tail + 1) % QUEUE_SIZE;
     notEmpty.trigger();
     return true;


More information about the x265-devel mailing list