History

examples/encode_audio: constify AVCodec instances

Anton Khirnov committed 10 years ago

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

Unified · Split

doc/examples/encode_audio.c+4−4
@@ -37,7 +37,7 @@ · 36 unmodified lines
37#include "libavutil/samplefmt.h"37#include "libavutil/samplefmt.h"
38 38
39/* check that a given sample format is supported by the encoder */39/* check that a given sample format is supported by the encoder */
40static int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt)40static int check_sample_fmt(const AVCodec *codec, enum AVSampleFormat sample_fmt)
41{41{
42 const enum AVSampleFormat *p = codec->sample_fmts;42 const enum AVSampleFormat *p = codec->sample_fmts;
43 43
@@ -50,7 +50,7 @@ static int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt) · 6 unmodified lines
50}50}
51 51
52/* just pick the highest supported samplerate */52/* just pick the highest supported samplerate */
53static int select_sample_rate(AVCodec *codec)53static int select_sample_rate(const AVCodec *codec)
54{54{
55 const int *p;55 const int *p;
56 int best_samplerate = 0;56 int best_samplerate = 0;
@@ -67,7 +67,7 @@ static int select_sample_rate(AVCodec *codec) · 10 unmodified lines
67}67}
68 68
69/* select layout with the highest channel count */69/* select layout with the highest channel count */
70static int select_channel_layout(AVCodec *codec)70static int select_channel_layout(const AVCodec *codec)
71{71{
72 const uint64_t *p;72 const uint64_t *p;
73 uint64_t best_ch_layout = 0;73 uint64_t best_ch_layout = 0;
@@ -92,7 +92,7 @@ static int select_channel_layout(AVCodec *codec) · 18 unmodified lines
92int main(int argc, char **argv)92int main(int argc, char **argv)
93{93{
94 const char *filename;94 const char *filename;
95 AVCodec *codec;95 const AVCodec *codec;
96 AVCodecContext *c= NULL;96 AVCodecContext *c= NULL;
97 AVFrame *frame;97 AVFrame *frame;
98 AVPacket pkt;98 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