summaryrefslogtreecommitdiffstats
path: root/libavcodec/libdav1d.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/libdav1d.c')
-rw-r--r--libavcodec/libdav1d.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 8335751..9ad735c 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -131,7 +131,8 @@ static av_cold int libdav1d_init(AVCodecContext *c)
s.allocator.alloc_picture_callback = libdav1d_picture_allocator;
s.allocator.release_picture_callback = libdav1d_picture_release;
s.frame_size_limit = c->max_pixels;
- s.apply_grain = dav1d->apply_grain;
+ if (dav1d->apply_grain >= 0)
+ s.apply_grain = dav1d->apply_grain;
s.n_tile_threads = dav1d->tile_threads
? dav1d->tile_threads
@@ -342,7 +343,7 @@ static av_cold int libdav1d_close(AVCodecContext *c)
static const AVOption libdav1d_options[] = {
{ "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD },
{ "framethreads", "Frame threads", OFFSET(frame_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD },
- { "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VD },
+ { "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD },
{ NULL }
};
OpenPOWER on IntegriCloud