mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
snappy: Refactor so ff_snappy_uncompress() uses an existing buffer
Some uses of Snappy require uncompressing to positions within an existing buffer. Also adds a function to get the uncompressed length of Snappy data.
This commit is contained in:
committed by
Vittorio Giovara
parent
7f388c0fab
commit
083cbc930d
+6
-1
@@ -108,8 +108,13 @@ static int setup_texture(AVCodecContext *avctx, size_t length)
|
||||
compressorstr = "none";
|
||||
break;
|
||||
case HAP_COMP_SNAPPY:
|
||||
snappy_size = ff_snappy_peek_uncompressed_length(gbc);
|
||||
ret = av_reallocp(&ctx->snappied, snappy_size);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
/* Uncompress the frame */
|
||||
ret = ff_snappy_uncompress(gbc, &ctx->snappied, &snappy_size);
|
||||
ret = ff_snappy_uncompress(gbc, ctx->snappied, &snappy_size);
|
||||
if (ret < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Snappy uncompress error\n");
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user