22 lines
360 B
C++
22 lines
360 B
C++
#include "ffcpp.h"
|
|
#include <stdexcept>
|
|
|
|
extern "C" {
|
|
#include <libavformat/avformat.h>
|
|
}
|
|
|
|
namespace ffcpp {
|
|
|
|
void init() {
|
|
av_register_all();
|
|
}
|
|
|
|
void throwIfError(int result, const std::string& description) {
|
|
if(result < 0) {
|
|
char errStr[260];
|
|
av_strerror(result, errStr, 260);
|
|
throw std::runtime_error(description + ": " + errStr);
|
|
}
|
|
}
|
|
|
|
} |