[FFmpeg-devel] [PATCH] Rename ffadler to ffhash and expand it using the generic hash API
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Wed May 15 21:45:11 CEST 2013
On Wed, May 15, 2013 at 04:05:35PM -0300, James Almer wrote:
> On 15/05/13 2:37 PM, Reimar Döffinger wrote:
> > As he mentioned earlier, this is because hash.c isn't really
> > behaving well for adler32/CRC.
> > If I understood right at the very least this should be done,
> > but I did not test:
> > --- a/libavutil/hash.c
> > +++ b/libavutil/hash.c
> > @@ -97,7 +97,7 @@ int av_hash_alloc(AVHashContext **ctx, const char *name)
> > case SHA224:
> > case SHA256: res->ctx = av_sha_alloc(); break;
> > case CRC32: res->crctab = av_crc_get_table(AV_CRC_32_IEEE); break;
> > - case ADLER32: break;
> > + case ADLER32: res->crc = 1; break;
> > }
> > if (i != ADLER32 && i != CRC32 && !res->ctx) {
> > av_free(res);
>
> The value is set in av_hash_init(). It needs to be changed from "ctx->crc = 0"
> to "ctx->crc = 1".
> If you make this change in alloc() it will be overwritten by init() afterwards.
Yeah, I didn't pay attention.
Could you maybe just send a patch for that? (And the WL->WB change and
possibly with what you came up with for CRC32).
More information about the ffmpeg-devel
mailing list