[FFmpeg-devel] [PATCH v2 3/3] avformat/hashenc: add streamhash muxer

Moritz Barsnick barsnick at gmx.net
Wed Sep 11 17:18:01 EEST 2019


On Wed, Sep 11, 2019 at 11:08:01 -0300, James Almer wrote:
> > +static int streamhash_init(struct AVFormatContext *s)
> > +{
> > +    int res, i;
> > +    struct HashContext *c = s->priv_data;
> > +    c->per_stream = 1;
> > +    c->hashes = av_mallocz_array(s->nb_streams, sizeof(c->hashes));
> > +    if (!c->hashes)
> > +        return AVERROR(ENOMEM);
> > +    for (i = 0; i < s->nb_streams; i++) {
> > +        res = av_hash_alloc(&c->hashes[i], c->hash_name);
> > +        if (res < 0) {
> > +            hash_free(s);
>
> No need to call this. It's done automatically by the generic code when
> this function returns an error.

Nice. I actually thought that, from your comment on patch 2/3. Will
resubmit (including 1/3, for completeness' sake) in a moment.

Thanks for the feedback,
Moritz


More information about the ffmpeg-devel mailing list