[x265] [PATCH 06 of 14] encoder: use %u to sprintf unsigned ints (refs #80)

Steve Borho steve at borho.org
Sat Sep 20 18:46:05 CEST 2014


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1411228379 -3600
#      Sat Sep 20 16:52:59 2014 +0100
# Node ID ef54dbef083274bf31c965fd5282cf6ec8eeee93
# Parent  b3c73568b1836f34de4abb06ffff0176f5e223e4
encoder: use %u to sprintf unsigned ints (refs #80)

diff -r b3c73568b183 -r ef54dbef0832 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Sat Sep 20 16:52:29 2014 +0100
+++ b/source/encoder/encoder.cpp	Sat Sep 20 16:52:59 2014 +0100
@@ -512,7 +512,7 @@
     double fps = (double)m_param->fpsNum / m_param->fpsDenom;
     double scale = fps / 1000 / (double)stat.m_numPics;
 
-    int len = sprintf(buffer, "%-6d, ", stat.m_numPics);
+    int len = sprintf(buffer, "%-6u, ", stat.m_numPics);
 
     len += sprintf(buffer + len, "%2.2lf, ", stat.m_totalQp / (double)stat.m_numPics);
     len += sprintf(buffer + len, "%-8.2lf, ", stat.m_accBits * scale);
@@ -538,7 +538,7 @@
     double fps = (double)m_param->fpsNum / m_param->fpsDenom;
     double scale = fps / 1000 / (double)stat.m_numPics;
 
-    int len = sprintf(buffer, "%6d, ", stat.m_numPics);
+    int len = sprintf(buffer, "%6u, ", stat.m_numPics);
 
     len += sprintf(buffer + len, "Avg QP:%2.2lf", stat.m_totalQp / (double)stat.m_numPics);
     len += sprintf(buffer + len, "  kb/s: %-8.2lf", stat.m_accBits * scale);


More information about the x265-devel mailing list