History

examples/encode_audio: constify AVCodec instances

Anton Khirnov committed 10 years ago

Commit c00a11a1 parent 40aaa8d1 file · +4 −4Browse files

Showing the changes to doc/examples/encode_audio.c (1 of 1 file). Show all

Unified · Split

doc/examples/encode_audio.c+4−4
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 #include "libavutil/samplefmt.h"
3838
3939 /* check that a given sample format is supported by the encoder */
40−static int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt)
40+static int check_sample_fmt(const AVCodec *codec, enum AVSampleFormat sample_fmt)
4141 {
4242 const enum AVSampleFormat *p = codec->sample_fmts;
4343
@@ -50,7 +50,7 @@ static int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt) · 6 unmodified lines
5050 }
5151
5252 /* just pick the highest supported samplerate */
53−static int select_sample_rate(AVCodec *codec)
53+static int select_sample_rate(const AVCodec *codec)
5454 {
5555 const int *p;
5656 int best_samplerate = 0;
@@ -67,7 +67,7 @@ static int select_sample_rate(AVCodec *codec) · 10 unmodified lines
6767 }
6868
6969 /* select layout with the highest channel count */
70−static int select_channel_layout(AVCodec *codec)
70+static int select_channel_layout(const AVCodec *codec)
7171 {
7272 const uint64_t *p;
7373 uint64_t best_ch_layout = 0;
@@ -92,7 +92,7 @@ static int select_channel_layout(AVCodec *codec) · 18 unmodified lines
9292 int main(int argc, char **argv)
9393 {
9494 const char *filename;
95− AVCodec *codec;
95+ const AVCodec *codec;
9696 AVCodecContext *c= NULL;
9797 AVFrame *frame;
9898 AVPacket pkt;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t