diff --git a/StMoviePlayer/StVideo/StAVPacketQueue.h b/StMoviePlayer/StVideo/StAVPacketQueue.h index fee900c8..7293bc29 100644 --- a/StMoviePlayer/StVideo/StAVPacketQueue.h +++ b/StMoviePlayer/StVideo/StAVPacketQueue.h @@ -229,9 +229,9 @@ class StAVPacketQueue { /** * Open stream. */ - ST_LOCAL virtual bool init(AVFormatContext* theFormatCtx, - const unsigned int theStreamId, - const StString& theFileName); + ST_LOCAL bool init(AVFormatContext* theFormatCtx, + const unsigned int theStreamId, + const StString& theFileName); protected: //! @name Fields should be full-controlled by heirs diff --git a/StMoviePlayer/StVideo/StAudioQueue.h b/StMoviePlayer/StVideo/StAudioQueue.h index cf220c65..2030b262 100644 --- a/StMoviePlayer/StVideo/StAudioQueue.h +++ b/StMoviePlayer/StVideo/StAudioQueue.h @@ -68,9 +68,9 @@ class StAudioQueue : public StAVPacketQueue { * @param theStreamId stream id in video format context * @return true if no error */ - ST_LOCAL virtual bool init(AVFormatContext* theFormatCtx, - const unsigned int theStreamId, - const StString& theFileName) ST_ATTR_OVERRIDE; + ST_LOCAL bool init(AVFormatContext* theFormatCtx, + const unsigned int theStreamId, + const StString& theFileName); /** * Clean function. diff --git a/StMoviePlayer/StVideo/StSubtitleQueue.h b/StMoviePlayer/StVideo/StSubtitleQueue.h index 4efbcf4f..59c9cde0 100644 --- a/StMoviePlayer/StVideo/StSubtitleQueue.h +++ b/StMoviePlayer/StVideo/StSubtitleQueue.h @@ -56,9 +56,9 @@ class StSubtitleQueue : public StAVPacketQueue { * @param streamId stream id in video format context * @return true if no error */ - ST_LOCAL virtual bool init(AVFormatContext* theFormatCtx, - const unsigned int theStreamId, - const StString& theFileName) ST_ATTR_OVERRIDE; + ST_LOCAL bool init(AVFormatContext* theFormatCtx, + const unsigned int theStreamId, + const StString& theFileName); /** * Clean function. diff --git a/StMoviePlayer/StVideo/StVideo.cpp b/StMoviePlayer/StVideo/StVideo.cpp index 7f3920f2..39cfa8f1 100644 --- a/StMoviePlayer/StVideo/StVideo.cpp +++ b/StMoviePlayer/StVideo/StVideo.cpp @@ -34,6 +34,7 @@ namespace { return SV_THREAD_RETURN 0; } +#ifdef ST_AV_NEWCODECPAR /** * Format framerate value. */ @@ -52,6 +53,7 @@ namespace { } return aBuff; } +#endif /** * Format stream info. diff --git a/include/StStrings/StStringUnicode.inl b/include/StStrings/StStringUnicode.inl index 3f357d13..6ffd718f 100644 --- a/include/StStrings/StStringUnicode.inl +++ b/include/StStrings/StStringUnicode.inl @@ -181,14 +181,7 @@ StStringUnicode::StStringUnicode(const int64_t theInt64) { this->Size = 0; this->Length = 0; char aBuff[32]; -#if defined(_MSC_VER) - stsprintf(aBuff, 32, "%I64i", theInt64); -#elif (defined(_WIN64) || defined(__WIN64__)\ - || defined(_LP64) || defined(__LP64__)) - stsprintf(aBuff, 32, "%li", theInt64); -#else - stsprintf(aBuff, 32, "%lli", theInt64); -#endif + stsprintf(aBuff, 32, "%" PRId64, theInt64); fromUnicode(aBuff); } @@ -198,14 +191,7 @@ StStringUnicode::StStringUnicode(const uint64_t theUInt64) { this->Size = 0; this->Length = 0; char aBuff[32]; -#if defined(_MSC_VER) - stsprintf(aBuff, 32, "%I64u", theUInt64); -#elif (defined(_WIN64) || defined(__WIN64__)\ - || defined(_LP64) || defined(__LP64__)) - stsprintf(aBuff, 32, "%lu", theUInt64); -#else - stsprintf(aBuff, 32, "%llu", theUInt64); -#endif + stsprintf(aBuff, 32, "%" PRIu64, theUInt64); fromUnicode(aBuff); } @@ -216,14 +202,7 @@ StStringUnicode::StStringUnicode(const stInt64ext_t theInt64) { this->Size = 0; this->Length = 0; char aBuff[32]; -#if defined(_MSC_VER) - stsprintf(aBuff, 32, "%I64i", theInt64); -#elif (defined(_WIN64) || defined(__WIN64__)\ - || defined(_LP64) || defined(__LP64__)) - stsprintf(aBuff, 32, "%li", theInt64); -#else - stsprintf(aBuff, 32, "%lli", theInt64); -#endif + stsprintf(aBuff, 32, "%" PRId64, (int64_t )theInt64); fromUnicode(aBuff); } @@ -233,14 +212,7 @@ StStringUnicode::StStringUnicode(const stUInt64ext_t theUInt64) { this->Size = 0; this->Length = 0; char aBuff[32]; -#if defined(_MSC_VER) - stsprintf(aBuff, 32, "%I64u", theUInt64); -#elif (defined(_WIN64) || defined(__WIN64__)\ - || defined(_LP64) || defined(__LP64__)) - stsprintf(aBuff, 32, "%lu", theUInt64); -#else - stsprintf(aBuff, 32, "%llu", theUInt64); -#endif + stsprintf(aBuff, 32, "%" PRIu64, (uint64_t )theUInt64); fromUnicode(aBuff); } #endif diff --git a/include/stTypes.h b/include/stTypes.h index a5bb1dc4..d71e5932 100644 --- a/include/stTypes.h +++ b/include/stTypes.h @@ -1,5 +1,5 @@ /** - * Copyright © 2009-2014 Kirill Gavrilov + * Copyright © 2009-2017 Kirill Gavrilov * * Distributed under the Boost Software License, Version 1.0. * See accompanying file license-boost.txt or copy at @@ -65,13 +65,13 @@ #endif #if defined(__cplusplus) && (__cplusplus >= 201100L) - // part of C++11 standard - #define ST_ATTR_OVERRIDE override + // part of C++11 standard + #define ST_ATTR_OVERRIDE override #elif defined(_MSC_VER) && (_MSC_VER >= 1700) - // versions before VS2012 emits warning as MSVC-specific extension - #define ST_ATTR_OVERRIDE override + // versions before VS2012 emits warning as MSVC-specific extension + #define ST_ATTR_OVERRIDE override #else - #define ST_ATTR_OVERRIDE + #define ST_ATTR_OVERRIDE #endif #if defined(_MSC_VER) @@ -84,6 +84,32 @@ #include // size_t, NULL #include #include // for memcpy + +#if(defined(_MSC_VER) && (_MSC_VER < 1800)) + // only Visual Studio 2013+ (vc12) provides header + #define PRId64 "I64d" + #define PRIu64 "I64u" + #define SCNd64 "I64d" + #define SCNu64 "I64u" + #ifdef _WIN64 + #define PRIdPTR "I64d" + #define PRIuPTR "I64u" + #define SCNdPTR "I64d" + #define SCNuPTR "I64u" + #else + #define PRIdPTR "d" + #define PRIuPTR "u" + #define SCNdPTR "d" + #define SCNuPTR "u" + #endif +#else + // use (C++11) for compatibility + #ifndef __STDC_FORMAT_MACROS + #define __STDC_FORMAT_MACROS + #endif + #include +#endif + #if defined(__i386) || defined(__x86_64) || defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64) #include // for memory alignment #endif