History

examples: unbreak compilation

Update api so it will compile again.

Luca Barbato committed 14 years ago

Commit aac63ce1 parent e04ca1d2 files · +9 −19Browse files

Showing the changes to libavcodec/api-example.c (1 of 2 files). Show all

Unified · Split

libavcodec/api-example.c+4−7
@@ -74,7 +74,7 @@ static void audio_encode_example(const char *filename) · 73 unmodified lines
7474 c->channels = 2;
7575
7676 /* open it */
77− if (avcodec_open(c, codec) < 0) {
77+ if (avcodec_open2(c, codec, NULL) < 0) {
7878 fprintf(stderr, "could not open codec\n");
7979 exit(1);
8080 }
@@ -139,7 +139,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 58 unmodified lines
139139 c = avcodec_alloc_context3(codec);
140140
141141 /* open it */
142− if (avcodec_open(c, codec) < 0) {
142+ if (avcodec_open2(c, codec, NULL) < 0) {
143143 fprintf(stderr, "could not open codec\n");
144144 exit(1);
145145 }
@@ -242,7 +242,7 @@ static void video_encode_example(const char *filename) · 96 unmodified lines
242242 c->pix_fmt = PIX_FMT_YUV420P;
243243
244244 /* open it */
245− if (avcodec_open(c, codec) < 0) {
245+ if (avcodec_open2(c, codec, NULL) < 0) {
246246 fprintf(stderr, "could not open codec\n");
247247 exit(1);
248248 }
@@ -369,7 +369,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 120 unmodified lines
369369 available in the bitstream. */
370370
371371 /* open it */
372− if (avcodec_open(c, codec) < 0) {
372+ if (avcodec_open2(c, codec, NULL) < 0) {
373373 fprintf(stderr, "could not open codec\n");
374374 exit(1);
375375 }
@@ -456,9 +456,6 @@ int main(int argc, char **argv) · 80 unmodified lines
456456 {
457457 const char *filename;
458458
459− /* must be called before using avcodec lib */
460− avcodec_init();
461−
462459 /* register all the codecs */
463460 avcodec_register_all();
464461

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