[x265] [PATCH] input:reset the file pointer before return in guessFrameCount()

Gopu Govindaswamy gopu at multicorewareinc.com
Tue Nov 5 09:43:00 CET 2013


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1383640959 -19800
# Node ID 84fb400ae55a17fdce1b0bfa9e208303cb85dcb1
# Parent  c57ed1fd7bd568b8662ba5f2ffb94eb01c3a0157
input:reset the file pointer before return in guessFrameCount()

diff -r c57ed1fd7bd5 -r 84fb400ae55a source/input/y4m.cpp
--- a/source/input/y4m.cpp	Tue Nov 05 00:39:00 2013 -0600
+++ b/source/input/y4m.cpp	Tue Nov 05 14:12:39 2013 +0530
@@ -251,9 +251,9 @@
 
     ifs->seekg(0, ios::end);
     istream::pos_type size = ifs->tellg();
+    ifs->seekg(cur, ios::beg);
     if (size < 0)
         return -1;
-    ifs->seekg(cur, ios::beg);
 
     return (int)((size - cur) / ((width * height * 3 / 2) + strlen(header) + 1));
 }
diff -r c57ed1fd7bd5 -r 84fb400ae55a source/input/yuv.cpp
--- a/source/input/yuv.cpp	Tue Nov 05 00:39:00 2013 -0600
+++ b/source/input/yuv.cpp	Tue Nov 05 14:12:39 2013 +0530
@@ -94,9 +94,9 @@
 
     ifs->seekg(0, ios::end);
     ifstream::pos_type size = ifs->tellg();
+    ifs->seekg(cur, ios::beg);
     if (size < 0)
         return -1;
-    ifs->seekg(cur, ios::beg);
 
     return (int)((size - cur) / (width * height * pixelbytes * 3 / 2));
 }


More information about the x265-devel mailing list