mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
Fixed *nix compile error.
This commit is contained in:
parent
056ec704f5
commit
e3a3da754e
@ -55,6 +55,13 @@ extern "C" DLLEXPORT void SetDebug(IDebug* debug) {
|
|||||||
::debug = debug;
|
::debug = debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string getAvError(int errnum) {
|
||||||
|
char buffer[AV_ERROR_MAX_STRING_SIZE];
|
||||||
|
buffer[0] = '\0';
|
||||||
|
av_make_error_string(buffer, AV_ERROR_MAX_STRING_SIZE, errnum);
|
||||||
|
return std::string(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
static int readCallback(void* opaque, uint8_t* buffer, int bufferSize) {
|
static int readCallback(void* opaque, uint8_t* buffer, int bufferSize) {
|
||||||
FfmpegDecoder* decoder = static_cast<FfmpegDecoder*>(opaque);
|
FfmpegDecoder* decoder = static_cast<FfmpegDecoder*>(opaque);
|
||||||
if (decoder && decoder->Stream()) {
|
if (decoder && decoder->Stream()) {
|
||||||
@ -209,7 +216,7 @@ bool FfmpegDecoder::GetBuffer(IBuffer *buffer) {
|
|||||||
else {
|
else {
|
||||||
std::string err =
|
std::string err =
|
||||||
"av_read_frame() failed: " +
|
"av_read_frame() failed: " +
|
||||||
std::string(av_err2str(readFrameResult));
|
getAvError(readFrameResult);
|
||||||
|
|
||||||
::debug->Warning(TAG, err.c_str());
|
::debug->Warning(TAG, err.c_str());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user