shithub: openh264

Download patch

ref: 3e13874a77196c53d561e4901b14025f30b1195d
parent: 8b8e0d4b3ed27be24708e80b9b25acbffe09d420
author: Martin Storsjö <[email protected]>
date: Sat Feb 8 19:33:25 EST 2014

Remove some needless casts by using the right data type

--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -58,7 +58,7 @@
 //#define STICK_STREAM_SIZE	// For Demo interfaces test with track file of integrated frames
 
 void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, const char* kpOuputFileName,
-                           int32_t& iWidth, int32_t& iHeight, void* pOptionFileName) {
+                         int32_t& iWidth, int32_t& iHeight, const char* pOptionFileName) {
   FILE* pH264File	  = NULL;
   FILE* pYuvFile	  = NULL;
   FILE* pOptionFile = NULL;
@@ -115,11 +115,11 @@
   }
 
   if (pOptionFileName) {
-    pOptionFile = fopen ((char*)pOptionFileName, "wb");
+    pOptionFile = fopen (pOptionFileName, "wb");
     if (pOptionFile == NULL) {
       fprintf (stderr, "Can not open optional file for write..\n");
     } else
-      fprintf (stderr, "Extra optional file: %s..\n", (char*)pOptionFileName);
+      fprintf (stderr, "Extra optional file: %s..\n", pOptionFileName);
   }
 
   printf ("------------------------------------------------------\n");
@@ -446,7 +446,7 @@
 
 
   H264DecodeInstance (pDecoder, strInputFile.c_str(), strOutputFile.c_str(), iWidth, iHeight,
-                      (!strOptionFile.empty() ? (void*) (const_cast<char*> (strOptionFile.c_str())) : NULL));
+                      (!strOptionFile.empty() ? strOptionFile.c_str() : NULL));
 
   if (sDecParam.pFileNameRestructed != NULL) {
     delete []sDecParam.pFileNameRestructed;