comparison h264_mp4toannexb_bsf.c @ 11859:f533ea0b236f libavcodec

Cosmetics: use and place braces correctly in if ... else statements.
author benoit
date Thu, 10 Jun 2010 06:00:06 +0000
parents fb5a6e98aa1c
children b39ced9e4fc3
comparison
equal deleted inserted replaced
11858:fb5a6e98aa1c 11859:f533ea0b236f
41 return AVERROR(ENOMEM); 41 return AVERROR(ENOMEM);
42 *poutbuf = tmp; 42 *poutbuf = tmp;
43 if (sps_pps) 43 if (sps_pps)
44 memcpy(*poutbuf+offset, sps_pps, sps_pps_size); 44 memcpy(*poutbuf+offset, sps_pps, sps_pps_size);
45 memcpy(*poutbuf+sps_pps_size+nal_header_size+offset, in, in_size); 45 memcpy(*poutbuf+sps_pps_size+nal_header_size+offset, in, in_size);
46 if (!offset) 46 if (!offset) {
47 AV_WB32(*poutbuf+sps_pps_size, 1); 47 AV_WB32(*poutbuf+sps_pps_size, 1);
48 else { 48 } else {
49 (*poutbuf+offset+sps_pps_size)[0] = (*poutbuf+offset+sps_pps_size)[1] = 0; 49 (*poutbuf+offset+sps_pps_size)[0] = (*poutbuf+offset+sps_pps_size)[1] = 0;
50 (*poutbuf+offset+sps_pps_size)[2] = 1; 50 (*poutbuf+offset+sps_pps_size)[2] = 1;
51 } 51 }
52 52
53 return 0; 53 return 0;
125 *poutbuf = NULL; 125 *poutbuf = NULL;
126 do { 126 do {
127 if (buf + ctx->length_size > buf_end) 127 if (buf + ctx->length_size > buf_end)
128 goto fail; 128 goto fail;
129 129
130 if (ctx->length_size == 1) 130 if (ctx->length_size == 1) {
131 nal_size = buf[0]; 131 nal_size = buf[0];
132 else if (ctx->length_size == 2) 132 } else if (ctx->length_size == 2) {
133 nal_size = AV_RB16(buf); 133 nal_size = AV_RB16(buf);
134 else 134 } else
135 nal_size = AV_RB32(buf); 135 nal_size = AV_RB32(buf);
136 136
137 buf += ctx->length_size; 137 buf += ctx->length_size;
138 unit_type = *buf & 0x1f; 138 unit_type = *buf & 0x1f;
139 139
145 if (alloc_and_copy(poutbuf, poutbuf_size, 145 if (alloc_and_copy(poutbuf, poutbuf_size,
146 avctx->extradata, avctx->extradata_size, 146 avctx->extradata, avctx->extradata_size,
147 buf, nal_size) < 0) 147 buf, nal_size) < 0)
148 goto fail; 148 goto fail;
149 ctx->first_idr = 0; 149 ctx->first_idr = 0;
150 } 150 } else {
151 else {
152 if (alloc_and_copy(poutbuf, poutbuf_size, 151 if (alloc_and_copy(poutbuf, poutbuf_size,
153 NULL, 0, 152 NULL, 0,
154 buf, nal_size) < 0) 153 buf, nal_size) < 0)
155 goto fail; 154 goto fail;
156 if (!ctx->first_idr && unit_type == 1) 155 if (!ctx->first_idr && unit_type == 1)