On Sat, Jul 28, 2012 at 12:42:25PM +0200, Anton Khirnov wrote:
>
> --- a/libavformat/wv.c
> +++ b/libavformat/wv.c
> @@ -87,27 +87,27 @@ static int wv_read_block_header(AVFormatContext *ctx,
> AVIOContext *pb, int appen
>
> - if(size < 24 || size > WV_BLOCK_LIMIT){
> + if (size < 24 || size > WV_BLOCK_LIMIT){
> - if(ver < 0x402 || ver > 0x410){
> + if (ver < 0x402 || ver > 0x410){
space before {, probably more in other places
> @@ -115,51 +115,43 @@ static int wv_read_block_header(AVFormatContext *ctx,
> AVIOContext *pb, int appen
> - switch(size - 2){
> - case 0:
> - chmask = avio_r8(pb);
> - break;
> - case 1:
> - chmask = avio_rl16(pb);
> - break;
> - case 2:
> - chmask = avio_rl24(pb);
> - break;
> - case 3:
> - chmask = avio_rl32(pb);
> - break;
> + switch (size - 2) {
> + case 0: chmask = avio_r8(pb); break;
> + case 1: chmask = avio_rl16(pb); break;
> + case 2: chmask = avio_rl24(pb); break;
> + case 3: chmask = avio_rl32(pb); break;
> case 5:
> avio_skip(pb, 1);
> - chan |= (avio_r8(pb) & 0xF) << 8;
> + chan |= (avio_r8(pb) & 0xF) << 8;
> chmask = avio_rl24(pb);
> break;
> default:
That's not an improvement, just leave the lines broken.
> @@ -173,29 +165,29 @@ static int wv_read_block_header(AVFormatContext *ctx,
> AVIOContext *pb, int appen
> - if(!wc->bpp) wc->bpp = bpp;
> - if(!wc->chan) wc->chan = chan;
> - if(!wc->chmask) wc->chmask = chmask;
> - if(!wc->rate) wc->rate = rate;
> + if (!wc->bpp) wc->bpp = bpp;
> + if (!wc->chan) wc->chan = chan;
> + if (!wc->chmask) wc->chmask = chmask;
> + if (!wc->rate) wc->rate = rate;
Break the lines please.
> @@ -256,41 +247,41 @@ static int wv_read_packet(AVFormatContext *s,
>
> if (s->pb->eof_reached)
> return AVERROR_EOF;
> - if(wc->block_parsed){
> + if (wc->block_parsed) {
> if ((ret = wv_read_block_header(s, s->pb, 0)) < 0)
> return ret;
> }
I'd drop the {}, but that may just be me ..
> @@ -345,19 +336,19 @@ static int wv_read_seek(AVFormatContext *s, int
> stream_index, int64_t timestamp,
> - do{
> + do {
> ret = av_read_frame(s, pkt);
> - if (ret < 0){
> + if (ret < 0) {
> avio_seek(s->pb, pos, SEEK_SET);
> return ret;
> }
> pts = pkt->pts;
> av_free_packet(pkt);
> - }while(pts < timestamp);
> + } while(pts < timestamp);
while (
If you can muster the motivation, there are a number of long
lines in that file...
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel