avformat/hashenc: Reuse hash_free() for framehash muxers
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
494f868e93
commit
e0e9c94c2b
@ -156,6 +156,7 @@ static int hash_write_trailer(struct AVFormatContext *s)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void hash_free(struct AVFormatContext *s)
|
static void hash_free(struct AVFormatContext *s)
|
||||||
{
|
{
|
||||||
@ -168,7 +169,6 @@ static void hash_free(struct AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
av_freep(&c->hashes);
|
av_freep(&c->hashes);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CONFIG_HASH_MUXER
|
#if CONFIG_HASH_MUXER
|
||||||
static const AVClass hashenc_class = {
|
static const AVClass hashenc_class = {
|
||||||
@ -326,14 +326,6 @@ static int framehash_write_packet(struct AVFormatContext *s, AVPacket *pkt)
|
|||||||
avio_printf(s->pb, "\n");
|
avio_printf(s->pb, "\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void framehash_free(struct AVFormatContext *s)
|
|
||||||
{
|
|
||||||
struct HashContext *c = s->priv_data;
|
|
||||||
if (c->hashes)
|
|
||||||
av_hash_freep(&c->hashes[0]);
|
|
||||||
av_freep(&c->hashes);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_FRAMEHASH_MUXER
|
#if CONFIG_FRAMEHASH_MUXER
|
||||||
@ -353,7 +345,7 @@ AVOutputFormat ff_framehash_muxer = {
|
|||||||
.init = framehash_init,
|
.init = framehash_init,
|
||||||
.write_header = framehash_write_header,
|
.write_header = framehash_write_header,
|
||||||
.write_packet = framehash_write_packet,
|
.write_packet = framehash_write_packet,
|
||||||
.deinit = framehash_free,
|
.deinit = hash_free,
|
||||||
.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
|
.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
|
||||||
AVFMT_TS_NEGATIVE,
|
AVFMT_TS_NEGATIVE,
|
||||||
.priv_class = &framehash_class,
|
.priv_class = &framehash_class,
|
||||||
@ -377,7 +369,7 @@ AVOutputFormat ff_framemd5_muxer = {
|
|||||||
.init = framehash_init,
|
.init = framehash_init,
|
||||||
.write_header = framehash_write_header,
|
.write_header = framehash_write_header,
|
||||||
.write_packet = framehash_write_packet,
|
.write_packet = framehash_write_packet,
|
||||||
.deinit = framehash_free,
|
.deinit = hash_free,
|
||||||
.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
|
.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
|
||||||
AVFMT_TS_NEGATIVE,
|
AVFMT_TS_NEGATIVE,
|
||||||
.priv_class = &framemd5_class,
|
.priv_class = &framemd5_class,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user