summaryrefslogtreecommitdiff
path: root/libavcodec/h264_mp4toannexb_bsf.c
diff options
context:
space:
mode:
authorBenoit Fouet <benoit.fouet@free.fr>2010-06-10 06:00:06 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2010-06-10 06:00:06 +0000
commit1f7d2f54c5ee6637998f11dbf44a99e956afb291 (patch)
tree055b6a06e45476806ef933cd922d842b06c5746d /libavcodec/h264_mp4toannexb_bsf.c
parent639c697c4fa192d3b3043523065c1e99bfd5f9fa (diff)
Cosmetics: use and place braces correctly in if ... else statements.
Originally committed as revision 23558 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264_mp4toannexb_bsf.c')
-rw-r--r--libavcodec/h264_mp4toannexb_bsf.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c
index 63653e4b67..e1d49c190f 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -43,9 +43,9 @@ static int alloc_and_copy(uint8_t **poutbuf, int *poutbuf_size,
if (sps_pps)
memcpy(*poutbuf+offset, sps_pps, sps_pps_size);
memcpy(*poutbuf+sps_pps_size+nal_header_size+offset, in, in_size);
- if (!offset)
+ if (!offset) {
AV_WB32(*poutbuf+sps_pps_size, 1);
- else {
+ } else {
(*poutbuf+offset+sps_pps_size)[0] = (*poutbuf+offset+sps_pps_size)[1] = 0;
(*poutbuf+offset+sps_pps_size)[2] = 1;
}
@@ -127,11 +127,11 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
if (buf + ctx->length_size > buf_end)
goto fail;
- if (ctx->length_size == 1)
+ if (ctx->length_size == 1) {
nal_size = buf[0];
- else if (ctx->length_size == 2)
+ } else if (ctx->length_size == 2) {
nal_size = AV_RB16(buf);
- else
+ } else
nal_size = AV_RB32(buf);
buf += ctx->length_size;
@@ -147,8 +147,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
buf, nal_size) < 0)
goto fail;
ctx->first_idr = 0;
- }
- else {
+ } else {
if (alloc_and_copy(poutbuf, poutbuf_size,
NULL, 0,
buf, nal_size) < 0)