Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp')
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp
index f2b7acc5ea2..197671ee37a 100644
--- a/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp
@@ -40,6 +40,7 @@ extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
+#include "ffmpeg_compat.h"
}
static const char* context_error = "AUD_FFMPEGWriter: Couldn't allocate context.";
@@ -127,7 +128,8 @@ AUD_FFMPEGWriter::AUD_FFMPEGWriter(std::string filename, AUD_DeviceSpecs specs,
m_codecCtx->bit_rate = bitrate;
m_codecCtx->sample_rate = int(m_specs.rate);
m_codecCtx->channels = m_specs.channels;
- m_codecCtx->time_base = (AVRational){1, m_codecCtx->sample_rate};
+ m_codecCtx->time_base.num = 1;
+ m_codecCtx->time_base.den = m_codecCtx->sample_rate;
switch(m_specs.format)
{
@@ -180,7 +182,7 @@ AUD_FFMPEGWriter::AUD_FFMPEGWriter(std::string filename, AUD_DeviceSpecs specs,
try
{
- if(avio_open(&m_formatCtx->pb, filename.c_str(), AVIO_WRONLY))
+ if(avio_open(&m_formatCtx->pb, filename.c_str(), AVIO_FLAG_WRITE))
AUD_THROW(AUD_ERROR_FILE, file_error);
avformat_write_header(m_formatCtx, NULL);