From dba6abec7de9c4e2d633db933621852ff445af2a Mon Sep 17 00:00:00 2001 From: jd84 Date: Wed, 8 Jan 2025 19:02:49 +0100 Subject: [PATCH 1/2] fixed compile error when using find_best_stream (expected type '?*?*const av.Codec', found '*?*av.Codec') --- av.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/av.zig b/av.zig index 6f8be6b875..1bc3293eb1 100644 --- a/av.zig +++ b/av.zig @@ -901,7 +901,7 @@ pub const FormatContext = extern struct { /// or -1 if none related_stream: c_int, ) Error!struct { c_uint, *const Codec } { - var decoder: ?*Codec = undefined; + var decoder: ?*const Codec = undefined; const n = try wrap(av_find_best_stream(ic, media_type, wanted_stream_nb, related_stream, &decoder, 0)); return .{ n, decoder.? }; } From d6ff28aebe9fa9d36cc7ce67f02f7890af71448b Mon Sep 17 00:00:00 2001 From: jd84 Date: Wed, 8 Jan 2025 19:04:40 +0100 Subject: [PATCH 2/2] fixed the return value of sws.Context.get to actually return a context as described --- av.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/av.zig b/av.zig index 1bc3293eb1..03df6c9d59 100644 --- a/av.zig +++ b/av.zig @@ -3744,7 +3744,7 @@ pub const sws = struct { /// Allocate and return an sws.Context. You need it to perform /// scaling/conversion operations using sws.Context.scale(). - pub fn get(srcW: c_int, srcH: c_int, srcFormat: PixelFormat, dstW: c_int, dstH: c_int, dstFormat: PixelFormat, flags: Flags, srcFilter: ?*sws.Filter, dstFilter: ?*sws.Filter, param: ?[*]const f64) error{OutOfMemory}!void { + pub fn get(srcW: c_int, srcH: c_int, srcFormat: PixelFormat, dstW: c_int, dstH: c_int, dstFormat: PixelFormat, flags: Flags, srcFilter: ?*sws.Filter, dstFilter: ?*sws.Filter, param: ?[*]const f64) error{OutOfMemory}!*Context { return sws_getContext(srcW, srcH, srcFormat, dstW, dstH, dstFormat, flags, srcFilter, dstFilter, param) orelse error.OutOfMemory; }