History

examples/decoding_encoding: apply various message log fixes

Stefano Sabatini committed 14 years ago

Commit 70b671a1 parent 8ad54a41 file · +26 −26Browse files

Unified · Split

doc/examples/decoding_encoding.c+26−26
@@ -116,7 +116,7 @@ static void audio_encode_example(const char *filename) · 115 unmodified lines
116116 /* find the MP2 encoder */
117117 codec = avcodec_find_encoder(AV_CODEC_ID_MP2);
118118 if (!codec) {
119− fprintf(stderr, "codec not found\n");
119+ fprintf(stderr, "Codec not found\n");
120120 exit(1);
121121 }
122122
@@ -128,7 +128,7 @@ static void audio_encode_example(const char *filename) · 5 unmodified lines
128128 /* check that the encoder supports s16 pcm input */
129129 c->sample_fmt = AV_SAMPLE_FMT_S16;
130130 if (!check_sample_fmt(codec, c->sample_fmt)) {
131− fprintf(stderr, "encoder does not support %s",
131+ fprintf(stderr, "Encoder does not support sample format %s",
132132 av_get_sample_fmt_name(c->sample_fmt));
133133 exit(1);
134134 }
@@ -140,20 +140,20 @@ static void audio_encode_example(const char *filename) · 5 unmodified lines
140140
141141 /* open it */
142142 if (avcodec_open2(c, codec, NULL) < 0) {
143− fprintf(stderr, "could not open codec\n");
143+ fprintf(stderr, "Could not open codec\n");
144144 exit(1);
145145 }
146146
147147 f = fopen(filename, "wb");
148148 if (!f) {
149− fprintf(stderr, "could not open %s\n", filename);
149+ fprintf(stderr, "Could not open %s\n", filename);
150150 exit(1);
151151 }
152152
153153 /* frame containing input raw audio */
154154 frame = avcodec_alloc_frame();
155155 if (!frame) {
156− fprintf(stderr, "could not allocate audio frame\n");
156+ fprintf(stderr, "Could not allocate audio frame\n");
157157 exit(1);
158158 }
159159
@@ -167,7 +167,7 @@ static void audio_encode_example(const char *filename) · 7 unmodified lines
167167 c->sample_fmt, 0);
168168 samples = av_malloc(buffer_size);
169169 if (!samples) {
170− fprintf(stderr, "could not allocate %d bytes for samples buffer\n",
170+ fprintf(stderr, "Could not allocate %d bytes for samples buffer\n",
171171 buffer_size);
172172 exit(1);
173173 }
@@ -175,7 +175,7 @@ static void audio_encode_example(const char *filename) · 1 unmodified line
175175 ret = avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt,
176176 (const uint8_t*)samples, buffer_size, 0);
177177 if (ret < 0) {
178− fprintf(stderr, "could not setup audio frame\n");
178+ fprintf(stderr, "Could not setup audio frame\n");
179179 exit(1);
180180 }
181181
@@ -197,7 +197,7 @@ static void audio_encode_example(const char *filename) · 15 unmodified lines
197197 /* encode the samples */
198198 ret = avcodec_encode_audio2(c, &pkt, frame, &got_output);
199199 if (ret < 0) {
200− fprintf(stderr, "error encoding audio frame\n");
200+ fprintf(stderr, "Error encoding audio frame\n");
201201 exit(1);
202202 }
203203 if (got_output) {
@@ -210,7 +210,7 @@ static void audio_encode_example(const char *filename) · 6 unmodified lines
210210 for (got_output = 1; got_output; i++) {
211211 ret = avcodec_encode_audio2(c, &pkt, NULL, &got_output);
212212 if (ret < 0) {
213− fprintf(stderr, "error encoding frame\n");
213+ fprintf(stderr, "Error encoding frame\n");
214214 exit(1);
215215 }
216216
@@ -247,7 +247,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 30 unmodified lines
247247 /* find the mpeg audio decoder */
248248 codec = avcodec_find_decoder(AV_CODEC_ID_MP2);
249249 if (!codec) {
250− fprintf(stderr, "codec not found\n");
250+ fprintf(stderr, "Codec not found\n");
251251 exit(1);
252252 }
253253
@@ -255,13 +255,13 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 1 unmodified line
255255
256256 /* open it */
257257 if (avcodec_open2(c, codec, NULL) < 0) {
258− fprintf(stderr, "could not open codec\n");
258+ fprintf(stderr, "Could not open codec\n");
259259 exit(1);
260260 }
261261
262262 f = fopen(filename, "rb");
263263 if (!f) {
264− fprintf(stderr, "could not open %s\n", filename);
264+ fprintf(stderr, "Could not open %s\n", filename);
265265 exit(1);
266266 }
267267 outfile = fopen(outfilename, "wb");
@@ -279,7 +279,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 11 unmodified lines
279279
280280 if (!decoded_frame) {
281281 if (!(decoded_frame = avcodec_alloc_frame())) {
282− fprintf(stderr, "out of memory\n");
282+ fprintf(stderr, "Could not allocate audio frame\n");
283283 exit(1);
284284 }
285285 } else
@@ -341,7 +341,7 @@ static void video_encode_example(const char *filename, int codec_id) · 55 unmodified lines
341341 /* find the mpeg1 video encoder */
342342 codec = avcodec_find_encoder(codec_id);
343343 if (!codec) {
344− fprintf(stderr, "codec not found\n");
344+ fprintf(stderr, "Codec not found\n");
345345 exit(1);
346346 }
347347
@@ -363,13 +363,13 @@ static void video_encode_example(const char *filename, int codec_id) · 15 unmodified lines
363363
364364 /* open it */
365365 if (avcodec_open2(c, codec, NULL) < 0) {
366− fprintf(stderr, "could not open codec\n");
366+ fprintf(stderr, "Could not open codec\n");
367367 exit(1);
368368 }
369369
370370 f = fopen(filename, "wb");
371371 if (!f) {
372− fprintf(stderr, "could not open %s\n", filename);
372+ fprintf(stderr, "Could not open %s\n", filename);
373373 exit(1);
374374 }
375375
@@ -387,7 +387,7 @@ static void video_encode_example(const char *filename, int codec_id) · 11 unmodified lines
387387 ret = av_image_alloc(picture->data, picture->linesize, c->width, c->height,
388388 c->pix_fmt, 32);
389389 if (ret < 0) {
390− fprintf(stderr, "could not alloc raw picture buffer\n");
390+ fprintf(stderr, "Could not allocate raw picture buffer\n");
391391 exit(1);
392392 }
393393
@@ -419,12 +419,12 @@ static void video_encode_example(const char *filename, int codec_id) · 25 unmodified lines
419419 /* encode the image */
420420 ret = avcodec_encode_video2(c, &pkt, picture, &got_output);
421421 if (ret < 0) {
422− fprintf(stderr, "error encoding frame\n");
422+ fprintf(stderr, "Error encoding frame\n");
423423 exit(1);
424424 }
425425
426426 if (got_output) {
427− printf("encoding frame %3d (size=%5d)\n", i, pkt.size);
427+ printf("Write frame %3d (size=%5d)\n", i, pkt.size);
428428 fwrite(pkt.data, 1, pkt.size, f);
429429 av_free_packet(&pkt);
430430 }
@@ -436,12 +436,12 @@ static void video_encode_example(const char *filename, int codec_id) · 5 unmodified lines
436436
437437 ret = avcodec_encode_video2(c, &pkt, NULL, &got_output);
438438 if (ret < 0) {
439− fprintf(stderr, "error encoding frame\n");
439+ fprintf(stderr, "Error encoding frame\n");
440440 exit(1);
441441 }
442442
443443 if (got_output) {
444− printf("write frame %3d (size=%5d)\n", i, pkt.size);
444+ printf("Write frame %3d (size=%5d)\n", i, pkt.size);
445445 fwrite(pkt.data, 1, pkt.size, f);
446446 av_free_packet(&pkt);
447447 }
@@ -496,7 +496,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 48 unmodified lines
496496 /* find the mpeg1 video decoder */
497497 codec = avcodec_find_decoder(AV_CODEC_ID_MPEG1VIDEO);
498498 if (!codec) {
499− fprintf(stderr, "codec not found\n");
499+ fprintf(stderr, "Codec not found\n");
500500 exit(1);
501501 }
502502
@@ -510,7 +510,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 7 unmodified lines
510510
511511 /* open it */
512512 if (avcodec_open2(c, codec, NULL) < 0) {
513− fprintf(stderr, "could not open codec\n");
513+ fprintf(stderr, "Could not open codec\n");
514514 exit(1);
515515 }
516516
@@ -518,7 +518,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 1 unmodified line
518518
519519 f = fopen(filename, "rb");
520520 if (!f) {
521− fprintf(stderr, "could not open %s\n", filename);
521+ fprintf(stderr, "Could not open %s\n", filename);
522522 exit(1);
523523 }
524524
@@ -557,7 +557,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 32 unmodified lines
557557 exit(1);
558558 }
559559 if (got_picture) {
560− printf("saving frame %3d\n", frame);
560+ printf("Saving frame %3d\n", frame);
561561 fflush(stdout);
562562
563563 /* the picture is allocated by the decoder. no need to
@@ -579,7 +579,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 15 unmodified lines
579579 avpkt.size = 0;
580580 len = avcodec_decode_video2(c, picture, &got_picture, &avpkt);
581581 if (got_picture) {
582− printf("saving last frame %3d\n", frame);
582+ printf("Saving last frame %3d\n", frame);
583583 fflush(stdout);
584584
585585 /* the picture is allocated by the decoder. no need to

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