Skip to content
This repository was archived by the owner on Jun 11, 2020. It is now read-only.

Commit 916d1a5

Browse files
author
chelyaev
committed
Replacing deprecated AVCODEC_MAX_AUDIO_FRAME_SIZE with custom macro.
1 parent 02f709c commit 916d1a5

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

tutorial03.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <stdio.h>
3131

3232
#define SDL_AUDIO_BUFFER_SIZE 1024
33+
#define MAX_AUDIO_FRAME_SIZE 192000
3334

3435
typedef struct PacketQueue {
3536
AVPacketList *first_pkt, *last_pkt;
@@ -171,7 +172,7 @@ void audio_callback(void *userdata, Uint8 *stream, int len) {
171172
AVCodecContext *aCodecCtx = (AVCodecContext *)userdata;
172173
int len1, audio_size;
173174

174-
static uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
175+
static uint8_t audio_buf[(MAX_AUDIO_FRAME_SIZE * 3) / 2];
175176
static unsigned int audio_buf_size = 0;
176177
static unsigned int audio_buf_index = 0;
177178

tutorial04.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <math.h>
3535

3636
#define SDL_AUDIO_BUFFER_SIZE 1024
37+
#define MAX_AUDIO_FRAME_SIZE 192000
3738

3839
#define MAX_AUDIOQ_SIZE (5 * 16 * 1024)
3940
#define MAX_VIDEOQ_SIZE (5 * 256 * 1024)
@@ -65,7 +66,7 @@ typedef struct VideoState {
6566
int videoStream, audioStream;
6667
AVStream *audio_st;
6768
PacketQueue audioq;
68-
uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
69+
uint8_t audio_buf[(MAX_AUDIO_FRAME_SIZE * 3) / 2];
6970
unsigned int audio_buf_size;
7071
unsigned int audio_buf_index;
7172
AVFrame audio_frame;

tutorial05.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <math.h>
3232

3333
#define SDL_AUDIO_BUFFER_SIZE 1024
34+
#define MAX_AUDIO_FRAME_SIZE 192000
3435

3536
#define MAX_AUDIOQ_SIZE (5 * 16 * 1024)
3637
#define MAX_VIDEOQ_SIZE (5 * 256 * 1024)
@@ -69,7 +70,7 @@ typedef struct VideoState {
6970
AVStream *audio_st;
7071
PacketQueue audioq;
7172
AVFrame audio_frame;
72-
uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
73+
uint8_t audio_buf[(MAX_AUDIO_FRAME_SIZE * 3) / 2];
7374
unsigned int audio_buf_size;
7475
unsigned int audio_buf_index;
7576
AVPacket audio_pkt;

tutorial06.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <math.h>
3232

3333
#define SDL_AUDIO_BUFFER_SIZE 1024
34+
#define MAX_AUDIO_FRAME_SIZE 192000
3435

3536
#define MAX_AUDIOQ_SIZE (5 * 16 * 1024)
3637
#define MAX_VIDEOQ_SIZE (5 * 256 * 1024)
@@ -78,7 +79,7 @@ typedef struct VideoState {
7879
AVStream *audio_st;
7980
PacketQueue audioq;
8081
AVFrame audio_frame;
81-
uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
82+
uint8_t audio_buf[(MAX_AUDIO_FRAME_SIZE * 3) / 2];
8283
unsigned int audio_buf_size;
8384
unsigned int audio_buf_index;
8485
AVPacket audio_pkt;

tutorial07.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <math.h>
3030

3131
#define SDL_AUDIO_BUFFER_SIZE 1024
32+
#define MAX_AUDIO_FRAME_SIZE 192000
3233
#define MAX_AUDIOQ_SIZE (5 * 16 * 1024)
3334
#define MAX_VIDEOQ_SIZE (5 * 256 * 1024)
3435
#define AV_SYNC_THRESHOLD 0.01
@@ -70,7 +71,7 @@ typedef struct VideoState {
7071
AVStream *audio_st;
7172
PacketQueue audioq;
7273
AVFrame audio_frame;
73-
uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
74+
uint8_t audio_buf[(MAX_AUDIO_FRAME_SIZE * 3) / 2];
7475
unsigned int audio_buf_size;
7576
unsigned int audio_buf_index;
7677
AVPacket audio_pkt;

0 commit comments

Comments
 (0)