#include <libavformat/avformat.h>
#include <libavresample/avresample.h>
#include <libavutil/channel_layout.h>
+#include <libavutil/error.h>
#include <libavutil/frame.h>
+#include <libavutil/mem.h>
+#include <libavutil/opt.h>
#include <libavutil/rational.h>
#include <libavutil/samplefmt.h>
-#include <libavutil/opt.h>
}
#include <assert.h>
-
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <memory>
#include <string>
#include <vector>
#include "defs.h"
+#include "mux.h"
#include "timebase.h"
using namespace std;
ctx->channel_layout = AV_CH_LAYOUT_STEREO;
ctx->time_base = AVRational{1, TIMEBASE};
if (oformat->flags & AVFMT_GLOBALHEADER) {
- ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
if (avcodec_open2(ctx, codec, NULL) < 0) {
fprintf(stderr, "Could not open codec '%s'\n", codec_name.c_str());
{
AVCodecParameters *codecpar = avcodec_parameters_alloc();
avcodec_parameters_from_context(codecpar, ctx);
- return AVCodecParametersWithDeleter(codecpar, avcodec_parameters_free_unique);
+ return AVCodecParametersWithDeleter(codecpar);
}