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')
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp4
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp6
2 files changed, 6 insertions, 4 deletions
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
index ff2c526bf49..e9eea195208 100644
--- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
@@ -58,9 +58,9 @@ int AUD_FFMPEGReader::decode(AVPacket& packet, AUD_Buffer& buffer)
got_frame = 0;
if(!frame)
- frame = avcodec_alloc_frame();
+ frame = av_frame_alloc();
else
- avcodec_get_frame_defaults(frame);
+ av_frame_unref(frame);
read_length = avcodec_decode_audio4(m_codecCtx, frame, &got_frame, &packet);
if(read_length < 0)
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp
index 4ee99c723aa..3f95ac7a4da 100644
--- a/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp
@@ -202,7 +202,7 @@ AUD_FFMPEGWriter::AUD_FFMPEGWriter(std::string filename, AUD_DeviceSpecs specs,
m_frame = av_frame_alloc();
if (!m_frame)
AUD_THROW(AUD_ERROR_FFMPEG, codec_error);
- avcodec_get_frame_defaults(m_frame);
+ av_frame_unref(m_frame);
m_frame->linesize[0] = m_input_size * samplesize;
m_frame->format = m_codecCtx->sample_fmt;
m_frame->nb_samples = m_input_size;
@@ -224,7 +224,9 @@ AUD_FFMPEGWriter::AUD_FFMPEGWriter(std::string filename, AUD_DeviceSpecs specs,
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);
+ if(avformat_write_header(m_formatCtx, NULL) < 0) {
+ throw;
+ }
}
catch(AUD_Exception&)
{