diff --git a/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.cpp b/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.cpp index 660aa8b..4ec4f91 100644 --- a/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.cpp +++ b/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.cpp @@ -4,14 +4,13 @@ using namespace std; namespace ffmpegcpp { - FFmpegException::FFmpegException(string error) : exception(error.c_str()) + FFmpegException::FFmpegException(string error) : errormsg( error ) { } FFmpegException::FFmpegException(string error, int returnValue) - : exception( - (error + ": " + av_make_error_string(this->error, AV_ERROR_MAX_STRING_SIZE, returnValue)).c_str() - ) { + char av_error[AV_ERROR_MAX_STRING_SIZE]; + errormsg = error + ": " + av_make_error_string(av_error, AV_ERROR_MAX_STRING_SIZE, returnValue); } } \ No newline at end of file diff --git a/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.h b/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.h index d3da0dd..35d1ac7 100644 --- a/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.h +++ b/source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.h @@ -15,14 +15,13 @@ namespace ffmpegcpp FFmpegException(std::string error, int returnValue); - virtual char const* what() const + virtual char const* what() const noexcept { - return std::exception::what(); + return errormsg.c_str(); } private: - - char error[AV_ERROR_MAX_STRING_SIZE]; + std::string errormsg; }; } \ No newline at end of file diff --git a/source/ffmpeg-cpp/ffmpeg-cpp/Frame Sinks/FrameSinkStream.h b/source/ffmpeg-cpp/ffmpeg-cpp/Frame Sinks/FrameSinkStream.h index 483ff7e..e4ec466 100644 --- a/source/ffmpeg-cpp/ffmpeg-cpp/Frame Sinks/FrameSinkStream.h +++ b/source/ffmpeg-cpp/ffmpeg-cpp/Frame Sinks/FrameSinkStream.h @@ -2,7 +2,7 @@ #include "ffmpeg.h" #include "FrameWriter.h" -#include "Demuxing/Streamdata.h" +#include "Demuxing/StreamData.h" namespace ffmpegcpp { diff --git a/source/ffmpeg-cpp/ffmpeg-cpp/ffmpeg.h b/source/ffmpeg-cpp/ffmpeg-cpp/ffmpeg.h index 76cad06..00193b9 100644 --- a/source/ffmpeg-cpp/ffmpeg-cpp/ffmpeg.h +++ b/source/ffmpeg-cpp/ffmpeg-cpp/ffmpeg.h @@ -1,8 +1,12 @@ #pragma once -#define _CRTDBG_MAP_ALLOC -#include +#ifdef _WIN32 +#define _CRTDBG_MAP_ALLOC #include +#endif + +#include + extern "C" { #include @@ -16,4 +20,4 @@ extern "C" { #include #include #include -} \ No newline at end of file +}