Mercurial > libavcodec.hg
comparison apiexample.c @ 4564:f58de1bdb675 libavcodec
The memsetting of the end of buffer is not needed for audio.
author | takis |
---|---|
date | Thu, 22 Feb 2007 12:56:31 +0000 |
parents | de57979c3cd2 |
children | 4dbe6578f811 |
comparison
equal
deleted
inserted
replaced
4563:de57979c3cd2 | 4564:f58de1bdb675 |
---|---|
122 uint8_t *outbuf; | 122 uint8_t *outbuf; |
123 uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE], *inbuf_ptr; | 123 uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE], *inbuf_ptr; |
124 | 124 |
125 printf("Audio decoding\n"); | 125 printf("Audio decoding\n"); |
126 | 126 |
127 /* set end of buffer to 0 (this ensures that no overreading happens for damaged mpeg streams) */ | |
128 memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE); | |
129 | |
130 /* find the mpeg audio decoder */ | 127 /* find the mpeg audio decoder */ |
131 codec = avcodec_find_decoder(CODEC_ID_MP2); | 128 codec = avcodec_find_decoder(CODEC_ID_MP2); |
132 if (!codec) { | 129 if (!codec) { |
133 fprintf(stderr, "codec not found\n"); | 130 fprintf(stderr, "codec not found\n"); |
134 exit(1); | 131 exit(1); |