Commit d3435a6a authored by Jan Gerber's avatar Jan Gerber
Browse files

don't use deprecated AVCODEC_MAX_AUDIO_FRAME_SIZE

parent 3d4745b5
...@@ -47,6 +47,9 @@ ...@@ -47,6 +47,9 @@
#include "ffmpeg2theora.h" #include "ffmpeg2theora.h"
#include "avinfo.h" #include "avinfo.h"
#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
#define LENGTH(x) (sizeof(x) / sizeof(*x)) #define LENGTH(x) (sizeof(x) / sizeof(*x))
enum { enum {
...@@ -1069,8 +1072,8 @@ void ff2theora_output(ff2theora this) { ...@@ -1069,8 +1072,8 @@ void ff2theora_output(ff2theora this) {
int first = 1; int first = 1;
int audio_eos = 0, video_eos = 0, audio_done = 0, video_done = 0; int audio_eos = 0, video_eos = 0, audio_done = 0, video_done = 0;
int ret; int ret;
int16_t *audio_buf=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE); int16_t *audio_buf=av_malloc(4*MAX_AUDIO_FRAME_SIZE);
int16_t *resampled=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE); int16_t *resampled=av_malloc(4*MAX_AUDIO_FRAME_SIZE);
int16_t *audio_p=NULL; int16_t *audio_p=NULL;
int no_frames; int no_frames;
int no_samples; int no_samples;
...@@ -1531,7 +1534,7 @@ void ff2theora_output(ff2theora this) { ...@@ -1531,7 +1534,7 @@ void ff2theora_output(ff2theora this) {
while((audio_eos && !audio_done) || avpkt.size > 0 ) { while((audio_eos && !audio_done) || avpkt.size > 0 ) {
int samples=0; int samples=0;
int samples_out=0; int samples_out=0;
int data_size = 4*AVCODEC_MAX_AUDIO_FRAME_SIZE; int data_size = 4*MAX_AUDIO_FRAME_SIZE;
int bytes_per_sample = av_get_bytes_per_sample(aenc->sample_fmt); int bytes_per_sample = av_get_bytes_per_sample(aenc->sample_fmt);
if (avpkt.size > 0) { if (avpkt.size > 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment