Error C4576 in VS2015

I have error C4576 in Visual Studio 2015 when I tried to compile the file: transcoding.c.

The source code for this file is here: transcoding.c

error C4576: the type in parentheses, followed by the list of initializers, is the syntax for converting a non-standard explicit type

The error on line 127 in this instruction is:

enc_ctx->time_base = (AVRational) { 1, enc_ctx->sample_rate };

I used ffmpeg source in my project https://www.ffmpeg.org/download.html

I searched for a solution, but I can not fix the error

If someone found something like this, provide an idea

+5
source share
5 answers

, , VS2015 C99, , .

, , , .c , ++. ++ . ++ .

, , /TP ( " ++" ).

+5

, ... :

AVRational tb;
tb.num = 1;
tb.den = enc_ctx->sample_rate;

enc_ctx->time_base = tb;

enc_ctx->time_base.num = 1;
enc_ctx->time_base.den = enc_ctx->sample_rate;
+4

, C ++ . C99 ++. .

+1

. .

enc_ctx->time_base = AVRational { 1, enc_ctx->sample_rate };
0

"" - Microsoft C. . . Microsoft C , C , .

? C. Windows mingw-w64 - , , ... gcc, . , .

-1

Source: https://habr.com/ru/post/1612661/


All Articles