comparison oggtheora.c @ 2979:bfabfdf9ce55 libavcodec

COSMETICS: tabs --> spaces, some prettyprinting
author diego
date Thu, 22 Dec 2005 01:10:11 +0000
parents 5ea2a7f74817
children
comparison
equal deleted inserted replaced
2978:403183bbb505 2979:bfabfdf9ce55
43 43
44 thc->op.packet = buf; 44 thc->op.packet = buf;
45 thc->op.bytes = buf_size; 45 thc->op.bytes = buf_size;
46 46
47 if(theora_decode_packetin(&thc->state, &thc->op)) 47 if(theora_decode_packetin(&thc->state, &thc->op))
48 return -1; 48 return -1;
49 49
50 theora_decode_YUVout(&thc->state, &yuv); 50 theora_decode_YUVout(&thc->state, &yuv);
51 51
52 frame->data[0] = yuv.y; 52 frame->data[0] = yuv.y;
53 frame->data[1] = yuv.u; 53 frame->data[1] = yuv.u;
76 int size, hs, i; 76 int size, hs, i;
77 ogg_packet op; 77 ogg_packet op;
78 uint8_t *cdp; 78 uint8_t *cdp;
79 79
80 if(ctx->extradata_size < 6) 80 if(ctx->extradata_size < 6)
81 return -1; 81 return -1;
82 82
83 theora_info_init(&thc->info); 83 theora_info_init(&thc->info);
84 84
85 memset(&op, 0, sizeof(op)); 85 memset(&op, 0, sizeof(op));
86 cdp = ctx->extradata; 86 cdp = ctx->extradata;
87 size = ctx->extradata_size; 87 size = ctx->extradata_size;
88 88
89 for(i = 0; i < 3; i++){ 89 for(i = 0; i < 3; i++){
90 hs = *cdp++ << 8; 90 hs = *cdp++ << 8;
91 hs += *cdp++; 91 hs += *cdp++;
92 size -= 2; 92 size -= 2;
93 93
94 if(hs > size){ 94 if(hs > size){
95 av_log(ctx, AV_LOG_ERROR, "extradata too small: %i > %i\n", 95 av_log(ctx, AV_LOG_ERROR, "extradata too small: %i > %i\n",
96 hs, size); 96 hs, size);
97 return -1; 97 return -1;
98 } 98 }
99 99
100 op.packet = cdp; 100 op.packet = cdp;
101 op.bytes = hs; 101 op.bytes = hs;
102 op.b_o_s = !i; 102 op.b_o_s = !i;
103 if(theora_decode_header(&thc->info, &thc->comment, &op)) 103 if(theora_decode_header(&thc->info, &thc->comment, &op))
104 return -1; 104 return -1;
105 op.packetno++; 105 op.packetno++;
106 106
107 cdp += hs; 107 cdp += hs;
108 size -= hs; 108 size -= hs;
109 } 109 }
110 110
111 theora_decode_init(&thc->state, &thc->info); 111 theora_decode_init(&thc->state, &thc->info);
112 112
113 ctx->width = thc->info.width; 113 ctx->width = thc->info.width;