shithub: opusfile

Download patch

ref: 009ecafbe707ad6ad0f1a8e55b99f6e8cd4bf341
parent: e0d55f6ce520aa6bc407dfef4488ed2226765620
author: Timothy B. Terriberry <[email protected]>
date: Mon Oct 8 14:36:46 EDT 2012

Fix a couple of MSVC warnings.

--- a/src/internal.h
+++ b/src/internal.h
@@ -38,11 +38,14 @@
 typedef float      op_sample;
 # endif
 
-/*Disable excessive warnings about the order of operations.*/
 # if OP_GNUC_PREREQ(4,2)
+/*Disable excessive warnings about the order of operations.*/
 #  pragma GCC diagnostic ignored "-Wparentheses"
 # elif defined(_MSC_VER)
+/*Disable excessive warnings about the order of operations.*/
 #  pragma warning(disable:4554)
+/*Disable warnings about "deprecated" POSIX functions.*/
+#  pragma warning(disable:4996)
 # endif
 
 # if OP_GNUC_PREREQ(3,0)
--- a/src/opusfile.c
+++ b/src/opusfile.c
@@ -1627,7 +1627,7 @@
     ogg_int64_t den;
     if(OP_UNLIKELY(_bytes/(0x7FFFFFFFF/(48000*8))>=_samples))return 0x7FFFFFFF;
     den=_samples/(48000*8);
-    return (_bytes+(den>>1))/den;
+    return (opus_int32)((_bytes+(den>>1))/den);
   }
   if(OP_UNLIKELY(_samples<=0))return 0x7FFFFFFF;
   /*This can't actually overflow in normal operation: even with a pre-skip of