forked from bartvdbraak/blender
Fix FFMPEG build error with older versions after planar formats commit.
This commit is contained in:
parent
de9dffc61e
commit
07d027b102
@ -171,6 +171,20 @@ void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ((LIBAVCODEC_VERSION_MAJOR < 54) || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR < 28))
|
||||||
|
static inline
|
||||||
|
void avcodec_free_frame(AVFrame **frame)
|
||||||
|
{
|
||||||
|
/* don't need to do anything with old AVFrame
|
||||||
|
* since it does not have malloced members */
|
||||||
|
(void)frame;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ((LIBAVCODEC_VERSION_MAJOR > 54) || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR >= 13))
|
||||||
|
#define FFMPEG_HAVE_FRAME_CHANNEL_LAYOUT
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef FFMPEG_HAVE_AVIO
|
#ifndef FFMPEG_HAVE_AVIO
|
||||||
#define AVIO_FLAG_WRITE URL_WRONLY
|
#define AVIO_FLAG_WRITE URL_WRONLY
|
||||||
#define avio_open url_fopen
|
#define avio_open url_fopen
|
||||||
|
@ -135,7 +135,9 @@ static int write_audio_frame(void)
|
|||||||
frame = avcodec_alloc_frame();
|
frame = avcodec_alloc_frame();
|
||||||
frame->nb_samples = audio_input_samples;
|
frame->nb_samples = audio_input_samples;
|
||||||
frame->format = c->sample_fmt;
|
frame->format = c->sample_fmt;
|
||||||
|
#ifdef FFMPEG_HAVE_FRAME_CHANNEL_LAYOUT
|
||||||
frame->channel_layout = c->channel_layout;
|
frame->channel_layout = c->channel_layout;
|
||||||
|
#endif
|
||||||
|
|
||||||
AUD_readDevice(audio_mixdown_device, audio_input_buffer, audio_input_samples);
|
AUD_readDevice(audio_mixdown_device, audio_input_buffer, audio_input_samples);
|
||||||
audio_time += (double) audio_input_samples / (double) c->sample_rate;
|
audio_time += (double) audio_input_samples / (double) c->sample_rate;
|
||||||
|
Loading…
Reference in New Issue
Block a user