Skip to content

Commit 69dc71f

Browse files
committed
fixed some warnings
1 parent 3bd4c2f commit 69dc71f

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

FFmpegTutorial/Classes/0x02/FFTPlayer0x02.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ - (void)openStreamFunc
128128
//采样率
129129
int sample_rate = codecCtx->sample_rate;
130130
//声道数
131-
int channels = codecCtx->channels;
131+
int channels = codecCtx->ch_layout.nb_channels;
132132
//平均比特率
133133
int64_t brate = codecCtx->bit_rate;
134134
//时长

FFmpegTutorial/Classes/0x05/FFTPlayer0x05.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ - (int)openStreamComponent:(AVFormatContext *)ic streamIdx:(int)idx
122122
avctx->pkt_timebase = stream->time_base;
123123

124124
//查找解码器
125-
AVCodec *codec = avcodec_find_decoder(avctx->codec_id);
125+
const AVCodec *codec = avcodec_find_decoder(avctx->codec_id);
126126
if (!codec){
127127
avcodec_free_context(&avctx);
128128
return -1;

FFmpegTutorial/Classes/0x06/FFTDecoder0x06.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ - (int)open
7272
avctx->pkt_timebase = stream->time_base;
7373

7474
//查找解码器
75-
AVCodec *codec = avcodec_find_decoder(avctx->codec_id);
75+
const AVCodec *codec = avcodec_find_decoder(avctx->codec_id);
7676
if (!codec){
7777
avcodec_free_context(&avctx);
7878
return -1;

FFmpegTutorial/Classes/0x10/FFTDecoder0x10.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ - (int)open
7676
avctx->pkt_timebase = stream->time_base;
7777

7878
//查找解码器
79-
AVCodec *codec = avcodec_find_decoder(avctx->codec_id);
79+
const AVCodec *codec = avcodec_find_decoder(avctx->codec_id);
8080
if (!codec){
8181
avcodec_free_context(&avctx);
8282
return -1;

FFmpegTutorial/Classes/0x20/FFTDecoder0x20.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ - (int)open
7979
avctx->pkt_timebase = stream->time_base;
8080

8181
//查找解码器
82-
AVCodec *codec = avcodec_find_decoder(avctx->codec_id);
82+
const AVCodec *codec = avcodec_find_decoder(avctx->codec_id);
8383
if (!codec){
8484
avcodec_free_context(&avctx);
8585
return -1;
@@ -100,7 +100,7 @@ - (int)open
100100
if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
101101
self.format = avctx->sample_fmt;
102102
self.sampleRate = avctx->sample_rate;
103-
self.channelLayout = (int)avctx->channel_layout;
103+
self.channelLayout = (int)avctx->ch_layout.nb_channels;
104104
} else if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
105105
self.format = avctx->pix_fmt;
106106
self.picWidth = avctx->width;

FFmpegTutorial/Classes/common/FFTAudioResample.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ - (BOOL)resampleFrame:(AVFrame *)inF out:(AVFrame **)outP
7474

7575
//int64_t dst_ch_layout;
7676
//av_opt_get_int(d.swr_ctx, "out_channel_layout", 0, &dst_ch_layout);
77-
out_frame->channel_layout = inF->channel_layout;
77+
out_frame->channel_layout = inF->ch_layout.nb_channels;
7878
out_frame->sample_rate = self.out_sample_rate;
7979
out_frame->format = self.out_sample_fmt;
8080

FFmpegTutorial/Classes/common/FFTDecoder.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ - (int)open
8383
avctx->pkt_timebase = stream->time_base;
8484

8585
//查找解码器
86-
AVCodec *codec = avcodec_find_decoder(avctx->codec_id);
86+
const AVCodec *codec = avcodec_find_decoder(avctx->codec_id);
8787
if (!codec){
8888
avcodec_free_context(&avctx);
8989
return -1;
@@ -104,7 +104,7 @@ - (int)open
104104
if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
105105
self.format = avctx->sample_fmt;
106106
self.sampleRate = avctx->sample_rate;
107-
self.channelLayout = (int)avctx->channel_layout;
107+
self.channelLayout = (int)avctx->ch_layout.nb_channels;
108108
} else if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
109109
self.format = avctx->pix_fmt;
110110
self.picWidth = avctx->width;

0 commit comments

Comments
 (0)