On Thu, May 31, 2012 at 02:03:37PM -0700, Luca Barbato wrote:
> Cleanup and reindent.
> ---
>  libavformat/flvenc.c |  129 ++++++++++++++++++++++++++-----------------------
>  1 files changed, 68 insertions(+), 61 deletions(-)

There is no point in having two log message lines here.

  flvenc: K&R formatting cosmetics

> --- a/libavformat/flvenc.c
> +++ b/libavformat/flvenc.c
> @@ -99,16 +100,18 @@ static int get_audio_flags(AVFormatContext *s, 
> AVCodecContext *enc)
>      if (enc->channels > 1) {
>          flags |= FLV_STEREO;
>      }

drop {}?

> -    switch(enc->codec_id){
> +    switch(enc->codec_id) {

switch (

> @@ -184,34 +187,36 @@ static int flv_write_header(AVFormatContext *s)
>  
> -    for(i=0; i<s->nb_streams; i++){
> +    for (i=0; i<s->nb_streams; i++) {

spaces around operators

> -            if (s->streams[i]->r_frame_rate.den && 
> s->streams[i]->r_frame_rate.num) {
> +            if (s->streams[i]->r_frame_rate.den &&
> +                s->streams[i]->r_frame_rate.num) {
>                  framerate = av_q2d(s->streams[i]->r_frame_rate);
>              } else {
>                  framerate = 1/av_q2d(s->streams[i]->codec->time_base);

ditto

>              if(enc->codec_tag == 0) {
> -                av_log(s, AV_LOG_ERROR, "video codec not compatible with 
> flv\n");
> +                av_log(s, AV_LOG_ERROR,
> +                       "video codec not compatible with flv\n");

if (

> @@ -229,24 +234,24 @@ static int flv_write_header(AVFormatContext *s)
>      avio_write(pb, "FLV", 3);
>      avio_w8(pb,1);

space after comma

>      avio_w8(pb,   FLV_HEADER_FLAG_HASAUDIO * !!audio_enc
> -                 + FLV_HEADER_FLAG_HASVIDEO * !!video_enc);
> +                + FLV_HEADER_FLAG_HASVIDEO * !!video_enc);

Move the '+' to the previous line, then you can drop the weird multiple
spaces after comma.

>      avio_wb32(pb,9);
>      avio_wb32(pb,0);

space after comma

>      for(i=0; i<s->nb_streams; i++){
>          if(s->streams[i]->codec->codec_tag == 5){

see above

> @@ -268,10 +273,11 @@ static int flv_write_header(AVFormatContext *s)
>  
> @@ -380,7 +386,7 @@ static int flv_write_trailer(AVFormatContext *s)
>          AVCodecContext *enc = s->streams[i]->codec;
>          FLVStreamContext *sc = s->streams[i]->priv_data;

align

> @@ -404,16 +410,16 @@ static int flv_write_packet(AVFormatContext *s, 
> AVPacket *pkt)
>      FLVContext *flv = s->priv_data;
>      FLVStreamContext *sc = s->streams[pkt->stream_index]->priv_data;

align

>  //    av_log(s, AV_LOG_DEBUG, "type:%d pts: %"PRId64" size:%d\n", 
> enc->codec_type, timestamp, size);

long line

> -    else if(enc->codec_id == CODEC_ID_H264)
> +    else if (enc->codec_id == CODEC_ID_H264)
>          flags_size= 5;
>      else
>          flags_size= 1;

space before =

> @@ -499,22 +505,23 @@ static int flv_write_packet(AVFormatContext *s, 
> AVPacket *pkt)
> +        if (enc->codec_id == CODEC_ID_VP6)
> +            avio_w8(pb,0);
> +        else if (enc->codec_id == CODEC_ID_AAC)
> +            avio_w8(pb,1); // AAC raw
> +        else if (enc->codec_id == CODEC_ID_H264) {
> +            avio_w8(pb,1); // AVC NALU
> +            avio_wb24(pb,pkt->pts - pkt->dts);

space after comma

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

Reply via email to