# HG changeset patch # User ramiro # Date 1218595478 0 # Node ID 8813c715eb9da0f31512f1ea4be2d425f5579920 # Parent a8ddede2248f80111afe275f8625d766e4c52e84 mlp_parser: Initialize crc data in its own function. diff -r a8ddede2248f -r 8813c715eb9d mlp_parser.c --- a/mlp_parser.c Wed Aug 13 01:41:06 2008 +0000 +++ b/mlp_parser.c Wed Aug 13 02:44:38 2008 +0000 @@ -77,14 +77,19 @@ { uint16_t crc; + crc = av_crc(crc_2D, 0, buf, buf_size - 2); + crc ^= AV_RL16(buf + buf_size - 2); + return crc; +} + +static int av_cold mlp_parse_init(AVCodecParserContext *s) +{ if (!crc_init) { av_crc_init(crc_2D, 0, 16, 0x002D, sizeof(crc_2D)); crc_init = 1; } - crc = av_crc(crc_2D, 0, buf, buf_size - 2); - crc ^= AV_RL16(buf + buf_size - 2); - return crc; + return 0; } /** Read a major sync info header - contains high level information about @@ -305,7 +310,7 @@ AVCodecParser mlp_parser = { { CODEC_ID_MLP }, sizeof(MLPParseContext), - NULL, + mlp_parse_init, mlp_parse, NULL, };