Skip to content

Unix build fixes #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
7 changes: 3 additions & 4 deletions source/ffmpeg-cpp/ffmpeg-cpp/FFmpegException.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
2 changes: 1 addition & 1 deletion source/ffmpeg-cpp/ffmpeg-cpp/Frame Sinks/FrameSinkStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "ffmpeg.h"
#include "FrameWriter.h"
#include "Demuxing/Streamdata.h"
#include "Demuxing/StreamData.h"

namespace ffmpegcpp
{
Expand Down
10 changes: 7 additions & 3 deletions source/ffmpeg-cpp/ffmpeg-cpp/ffmpeg.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#pragma once

#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#ifdef _WIN32
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#endif

#include <stdlib.h>


extern "C" {
#include <libavcodec/avcodec.h>
Expand All @@ -16,4 +20,4 @@ extern "C" {
#include <libavfilter/buffersrc.h>
#include <libswresample/swresample.h>
#include <libavutil/audio_fifo.h>
}
}