comparison idcinvideo.c @ 1598:932d306bf1dc libavcodec

av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
author michael
date Mon, 03 Nov 2003 13:26:22 +0000
parents 6b224ca24033
children b0ec6f51b5bd
comparison
equal deleted inserted replaced
1597:4c9165372ab3 1598:932d306bf1dc
156 avctx->has_b_frames = 0; 156 avctx->has_b_frames = 0;
157 dsputil_init(&s->dsp, avctx); 157 dsputil_init(&s->dsp, avctx);
158 158
159 /* make sure the Huffman tables make it */ 159 /* make sure the Huffman tables make it */
160 if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) { 160 if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {
161 printf(" Id CIN video: expected extradata size of %d\n", HUFFMAN_TABLE_SIZE); 161 av_log(s->avctx, AV_LOG_ERROR, " Id CIN video: expected extradata size of %d\n", HUFFMAN_TABLE_SIZE);
162 return -1; 162 return -1;
163 } 163 }
164 164
165 /* build the 256 Huffman decode trees */ 165 /* build the 256 Huffman decode trees */
166 histograms = (unsigned char *)s->avctx->extradata; 166 histograms = (unsigned char *)s->avctx->extradata;
191 hnodes = s->huff_nodes[prev]; 191 hnodes = s->huff_nodes[prev];
192 192
193 while(node_num >= HUF_TOKENS) { 193 while(node_num >= HUF_TOKENS) {
194 if(!bit_pos) { 194 if(!bit_pos) {
195 if(dat_pos > s->size) { 195 if(dat_pos > s->size) {
196 printf("Huffman decode error.\n"); 196 av_log(s->avctx, AV_LOG_ERROR, "Huffman decode error.\n");
197 return; 197 return;
198 } 198 }
199 bit_pos = 8; 199 bit_pos = 8;
200 v = s->buf[dat_pos++]; 200 v = s->buf[dat_pos++];
201 } 201 }
223 223
224 if (s->frame.data[0]) 224 if (s->frame.data[0])
225 avctx->release_buffer(avctx, &s->frame); 225 avctx->release_buffer(avctx, &s->frame);
226 226
227 if (avctx->get_buffer(avctx, &s->frame)) { 227 if (avctx->get_buffer(avctx, &s->frame)) {
228 printf (" Id CIN Video: get_buffer() failed\n"); 228 av_log(avctx, AV_LOG_ERROR, " Id CIN Video: get_buffer() failed\n");
229 return -1; 229 return -1;
230 } 230 }
231 231
232 idcin_decode_vlcs(s); 232 idcin_decode_vlcs(s);
233 233