[FFmpeg-devel] [PATCH] FLAC parser
Justin Ruggles
justin.ruggles
Thu Aug 12 04:13:19 CEST 2010
Hi,
Michael Chinen wrote:
> Updated patch attached with one note:
>
> On Wed, Aug 11, 2010 at 11:52 PM, Justin Ruggles
> <justin.ruggles at gmail.com> wrote:
> [...]
>> As for the code duplication, maybe you could use something like this:
>>
>> static int check_header_mismatch(AVCodecContext *avctx,
>> FLACFrameInfo *header,
>> FLACFrameInfo *child,
>> int log_warning)
>
> Thanks, this was a good idea and I refactored the code accordingly. I
> left out log_warning and just checked avctx for non-NULL instead. If
> we need to log to NULL contexts we can change it in the future, but
> right now it doesn't do so.
Looks good. One more suggestion though.
> + /* Look at the child's frame header info and penalize changes. */
> + child_score = score_header(child);
> +
> + /* Penalize suspicious changes between the headers. */
> + child_score -= check_header_mismatch(NULL, &header->fi, &child->fi);
/* Look at the child's frame header info and penalize suspicious changes
between the headers. */
child_score = score_header(child) -
check_header_mismatch(NULL, &header->fi, &child->fi);
Cheers,
Justin
More information about the ffmpeg-devel
mailing list