On 07/09/2012 06:22 PM, Diego Biurrun wrote:
> On Mon, Jul 09, 2012 at 05:24:07PM -0400, Justin Ruggles wrote:
>>
>> --- a/libavcodec/alac.c
>> +++ b/libavcodec/alac.c
>> @@ -399,10 +384,11 @@ static int decode_element(AVCodecContext *avctx, void
>> *data, int ch_index,
>> /* not compressed, easy case */
>> for (i = 0; i < alac->nb_samples; i++) {
>> for (ch = 0; ch < channels; ch++) {
>> - alac->output_samples_buffer[ch][i] =
>> get_sbits_long(&alac->gb, alac->sample_size);
>> + alac->output_samples_buffer[ch][i] =
>> + get_sbits_long(&alac->gb, alac->sample_size);
>> }
>> }
>
> Indenting by 8 spaces seems arbitrary, we use 4.
> Drop the {} like in other places.
>
>> @@ -472,9 +458,10 @@ static int alac_decode_frame(AVCodecContext *avctx,
>> void *data,
>>
>> - if (avpkt->size * 8 - get_bits_count(&alac->gb) > 8)
>> + if (avpkt->size * 8 - get_bits_count(&alac->gb) > 8) {
>> av_log(avctx, AV_LOG_ERROR, "Error : %d bits left\n",
>> avpkt->size * 8 - get_bits_count(&alac->gb));
>> + }
>
> Why? We usually drop these - and you even do in this very patch.
Personally I prefer having the braces there if the block is more than 1
line, regardless of how many C statements it is. I think it makes it
easier to read.
-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel