Mercurial > libavcodec.hg
comparison libspeexdec.c @ 8768:4bb782c7793e libavcodec
cosmetics: Fix a few typos and use a consistent codec long name.
author | diego |
---|---|
date | Sun, 08 Feb 2009 23:32:46 +0000 |
parents | ed8906ba4bea |
children | 54bc8a2727b0 |
comparison
equal
deleted
inserted
replaced
8767:58fb0bcd6afd | 8768:4bb782c7793e |
---|---|
58 if (!mode) { | 58 if (!mode) { |
59 av_log(avctx, AV_LOG_ERROR, "Unknown Speex mode %d", s->header->mode); | 59 av_log(avctx, AV_LOG_ERROR, "Unknown Speex mode %d", s->header->mode); |
60 return -1; | 60 return -1; |
61 } | 61 } |
62 } else | 62 } else |
63 av_log(avctx, AV_LOG_INFO, "Missing speex header, assuming defaults\n"); | 63 av_log(avctx, AV_LOG_INFO, "Missing Speex header, assuming defaults.\n"); |
64 | 64 |
65 if (avctx->channels > 2) { | 65 if (avctx->channels > 2) { |
66 av_log(avctx, AV_LOG_ERROR, "Only stereo and mono supported\n"); | 66 av_log(avctx, AV_LOG_ERROR, "Only stereo and mono are supported.\n"); |
67 return -1; | 67 return -1; |
68 } | 68 } |
69 | 69 |
70 speex_bits_init(&s->bits); | 70 speex_bits_init(&s->bits); |
71 s->dec_state = speex_decoder_init(mode); | 71 s->dec_state = speex_decoder_init(mode); |
72 if (!s->dec_state) { | 72 if (!s->dec_state) { |
73 av_log(avctx, AV_LOG_ERROR, "Error initializing libspeex decoder\n"); | 73 av_log(avctx, AV_LOG_ERROR, "Error initializing libspeex decoder.\n"); |
74 return -1; | 74 return -1; |
75 } | 75 } |
76 | 76 |
77 if (!s->header) | 77 if (!s->header) |
78 speex_decoder_ctl(s->dec_state, SPEEX_GET_FRAME_SIZE, &avctx->frame_size); | 78 speex_decoder_ctl(s->dec_state, SPEEX_GET_FRAME_SIZE, &avctx->frame_size); |
102 speex_bits_read_from(&s->bits, buf, buf_size); | 102 speex_bits_read_from(&s->bits, buf, buf_size); |
103 | 103 |
104 for (i = 0; speex_bits_remaining(&s->bits) && output + num_samples < end; i++) { | 104 for (i = 0; speex_bits_remaining(&s->bits) && output + num_samples < end; i++) { |
105 int ret = speex_decode_int(s->dec_state, &s->bits, output); | 105 int ret = speex_decode_int(s->dec_state, &s->bits, output); |
106 if (ret <= -2) { | 106 if (ret <= -2) { |
107 av_log(avctx, AV_LOG_ERROR, "Error decoding speex frame\n"); | 107 av_log(avctx, AV_LOG_ERROR, "Error decoding Speex frame.\n"); |
108 return -1; | 108 return -1; |
109 } else if (ret == -1) | 109 } else if (ret == -1) |
110 // end of stream | 110 // end of stream |
111 break; | 111 break; |
112 | 112 |
138 sizeof(LibSpeexContext), | 138 sizeof(LibSpeexContext), |
139 libspeex_decode_init, | 139 libspeex_decode_init, |
140 NULL, | 140 NULL, |
141 libspeex_decode_close, | 141 libspeex_decode_close, |
142 libspeex_decode_frame, | 142 libspeex_decode_frame, |
143 .long_name = NULL_IF_CONFIG_SMALL("libspeex"), | 143 .long_name = NULL_IF_CONFIG_SMALL("libspeex Speex"), |
144 }; | 144 }; |