On 11/30/2011 03:52 PM, Chris Berov wrote:

> 
> 
> 0001-yuv4mpeg-cosmetics.patch
> 
> 
> From 0742363c9e66859298fbcbcb47a239442fa2f4de Mon Sep 17 00:00:00 2001
> From: unknown <[email protected]>
> Date: Wed, 30 Nov 2011 13:16:07 +0200
> Subject: [PATCH] yuv4mpeg: cosmetics
> 
> ---
>  libavformat/yuv4mpeg.c |  163 ++++++++++++++++++++++++++---------------------
>  1 files changed, 90 insertions(+), 73 deletions(-)
> 
> diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
> index e1db1a3..0d0bb5e 100644
> --- a/libavformat/yuv4mpeg.c
> +++ b/libavformat/yuv4mpeg.c

> @@ -63,8 +64,8 @@ static int yuv4_generate_header(AVFormatContext *s, char* 
> buf)
>          break;
>      case PIX_FMT_YUV420P:
>          colorspace = (st->codec->chroma_sample_location == 
> AVCHROMA_LOC_TOPLEFT)?" C420paldv XYSCSS=420PALDV":
> -                     (st->codec->chroma_sample_location == 
> AVCHROMA_LOC_LEFT)   ?" C420mpeg2 XYSCSS=420MPEG2":
> -                     " C420jpeg XYSCSS=420JPEG";
> +                (st->codec->chroma_sample_location == AVCHROMA_LOC_LEFT)?" 
> C420mpeg2 XYSCSS=420MPEG2":
> +                " C420jpeg XYSCSS=420JPEG";

this still doesn't look right. what makes it readable currently is the
vertical alignment. so please either leave it as-is or make it an
if/else.

> @@ -212,62 +221,67 @@ static int yuv4_read_header(AVFormatContext *s, 
> AVFormatParameters *ap)
>  
>      s1->interlaced_frame = 0;
>      s1->top_field_first = 0;
> -    header_end = &header[i+1]; // Include space
> -    for(tokstart = &header[strlen(Y4M_MAGIC) + 1]; tokstart < header_end; 
> tokstart++) {
> -        if (*tokstart==0x20) continue;
> +    header_end = &header[i + 1]; // Include space
> +    for (tokstart = &header[strlen(Y4M_MAGIC) + 1];
> +         tokstart < header_end; tokstart++) {
> +        if (*tokstart == 0x20) continue;


i missed this before. please put the "continue" on the next line and
indent it.

> -            while(tokstart<header_end&&*tokstart!=0x20) tokstart++;
> +            while (tokstart < header_end && *tokstart != 0x20)
> +            tokstart++;


here and elsewhere, the "tokstart++" needs to be properly indented

> @@ -371,9 +388,9 @@ static int yuv4_read_packet(AVFormatContext *s, AVPacket 
> *pkt)
>      if (av_get_packet(s->pb, pkt, packet_size) != packet_size)
>          return AVERROR(EIO);
>  
> -    if (s->streams[0]->codec->coded_frame) {
> -        s->streams[0]->codec->coded_frame->interlaced_frame = 
> s1->interlaced_frame;
> -        s->streams[0]->codec->coded_frame->top_field_first = 
> s1->top_field_first;
> +    if (st->codec->coded_frame) {
> +        st->codec->coded_frame->interlaced_frame = s1->interlaced_frame;
> +        st->codec->coded_frame->top_field_first = s1->top_field_first;


vertically align the "="

the rest looks good, thanks.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to