libutvideo: use K&R style.

This commit is contained in:
Clément Bœsch 2011-11-15 00:06:02 +01:00
parent 30ca700ba1
commit 3495817468

View File

@ -54,8 +54,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
int begin_ret;
unsigned int buf_size;
if(avctx->extradata_size != 4*4)
{
if (avctx->extradata_size != 4*4) {
av_log(avctx, AV_LOG_ERROR, "Extradata size mismatch.\n");
return -1;
}
@ -67,8 +66,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
info.flags = AV_RL32(avctx->extradata + 12);
/* Pick format based on FOURCC */
switch(avctx->codec_tag)
{
switch (avctx->codec_tag) {
case MKTAG('U', 'L', 'Y', '0'):
avctx->pix_fmt = PIX_FMT_YUV420P;
format = UTVF_YV12;
@ -95,8 +93,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
buf_size = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
utv->output = (uint8_t *)av_malloc(buf_size * sizeof(uint8_t));
if(utv->output == NULL)
{
if (utv->output == NULL) {
av_log(avctx, AV_LOG_ERROR, "Unable to allocate output buffer.\n");
return -1;
}
@ -124,8 +121,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
CBGROSSWIDTH_WINDOWS, &info, sizeof(UtVideoExtra));
/* Check to see if the decoder initlized properly */
if(begin_ret != 0)
{
if (begin_ret != 0) {
av_log(avctx, AV_LOG_ERROR,
"Could not initialize decoder: %d\n", begin_ret);
return -1;
@ -150,8 +146,7 @@ static int utvideo_decode_frame(AVCodecContext *avctx, void *data,
utv->codec->DecodeFrame(utv->output, avpkt->data, true);
/* Set the output data depending on the colorspace */
switch(avctx->pix_fmt)
{
switch (avctx->pix_fmt) {
case PIX_FMT_YUV420P:
pic->linesize[0] = w;
pic->linesize[1] = pic->linesize[2] = w / 2;