[FFmpeg-devel] [PATCH] avcodec/dvdec: Don't use restrict directly to fix build on MSVC

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sun Nov 10 03:47:24 EET 2019

004ebd4b added a function with a parameter that was declared as restrict
and not av_restrict. This is not supported by MSVC as several FATE-boxes
that now fail to build show. So use av_restrict.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
Here is one of many logs of a failing build with MSVC:

I don't have an MSVC setup and can therefore only attest that this patch
doesn't affect either GCC or Clang (as expected).

 libavcodec/dvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index cfa0fb9905..578d7f505f 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -269,7 +269,7 @@ static inline void bit_copy(PutBitContext *pb, GetBitContext *gb)
         put_bits(pb, bits_left, get_bits(gb, bits_left));
-static av_always_inline void put_block_8x4(int16_t *block, uint8_t *restrict p, int stride)
+static av_always_inline void put_block_8x4(int16_t *block, uint8_t *av_restrict p, int stride)
     int i, j;
     const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;

More information about the ffmpeg-devel mailing list