patch-src_ffmpeg2theora_c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. $OpenBSD: patch-src_ffmpeg2theora_c,v 1.3 2014/04/06 20:13:53 brad Exp $
  2. Deal with deprecated FFmpeg API.
  3. --- src/ffmpeg2theora.c.orig Thu Apr 3 01:58:34 2014
  4. +++ src/ffmpeg2theora.c Thu Apr 3 01:59:08 2014
  5. @@ -47,6 +47,8 @@
  6. #include "ffmpeg2theora.h"
  7. #include "avinfo.h"
  8. +#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
  9. +
  10. #define LENGTH(x) (sizeof(x) / sizeof(*x))
  11. enum {
  12. @@ -1068,8 +1070,8 @@ void ff2theora_output(ff2theora this) {
  13. int first = 1;
  14. int audio_eos = 0, video_eos = 0, audio_done = 0, video_done = 0;
  15. int ret;
  16. - int16_t *audio_buf=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
  17. - int16_t *resampled=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
  18. + int16_t *audio_buf=av_malloc(4*MAX_AUDIO_FRAME_SIZE);
  19. + int16_t *resampled=av_malloc(4*MAX_AUDIO_FRAME_SIZE);
  20. int16_t *audio_p=NULL;
  21. int no_frames;
  22. int no_samples;
  23. @@ -1530,7 +1532,7 @@ void ff2theora_output(ff2theora this) {
  24. while((audio_eos && !audio_done) || avpkt.size > 0 ) {
  25. int samples=0;
  26. int samples_out=0;
  27. - int data_size = 4*AVCODEC_MAX_AUDIO_FRAME_SIZE;
  28. + int data_size = 4*MAX_AUDIO_FRAME_SIZE;
  29. int bytes_per_sample = av_get_bytes_per_sample(aenc->sample_fmt);
  30. if (avpkt.size > 0) {