Skip to content

Commit

Permalink
Qt GUI build fix for new ffmpeg macro that expands to a C++20 designa…
Browse files Browse the repository at this point in the history
…ted initializer that is not supported by earlier compiler standards.
  • Loading branch information
thor2016 committed Jan 15, 2023
1 parent 9a969ed commit 8a59bd3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pipelines/win32_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ set DEPLOY_GROUP=master
IF DEFINED APPVEYOR_REPO_TAG_NAME set DEPLOY_GROUP=%APPVEYOR_REPO_TAG_NAME%

msbuild %PROJECT_ROOT%\vc\vc14_fceux.vcxproj /p:Configuration=%BUILD_CONFIG% /p:Platform="Win32"
@if ERRORLEVEL 1 goto end
if %ERRORLEVEL% NEQ 0 EXIT /B 1

cd %PROJECT_ROOT%\vc

REM Create Zip Archive
cd %PROJECT_ROOT%\output
..\vc\zip -X -9 -r ..\vc\%ZIP_FILENAME% fceux.exe fceux.chm taseditor.chm lua5.1.dll lua51.dll 7z.dll auxlib.lua palettes luaScripts tools
@if ERRORLEVEL 1 goto end
if %ERRORLEVEL% NEQ 0 EXIT /B 1

cd %PROJECT_ROOT%

Expand Down
6 changes: 3 additions & 3 deletions pipelines/win64_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ set DEPLOY_GROUP=master
IF DEFINED APPVEYOR_REPO_TAG_NAME set DEPLOY_GROUP=%APPVEYOR_REPO_TAG_NAME%

msbuild %PROJECT_ROOT%\vc\vc14_fceux.vcxproj /p:Configuration=%BUILD_CONFIG% /p:Platform="x64"
@if ERRORLEVEL 1 goto end
if %ERRORLEVEL% NEQ 0 EXIT /B 1

cd %PROJECT_ROOT%\vc

REM Create Zip Archive

cd %PROJECT_ROOT%\output
..\vc\zip -X -9 -j ..\vc\%ZIP_FILENAME% ..\vc\x64\%BUILD_CONFIG%\fceux64.exe ..\src\drivers\win\lua\x64\lua5.1.dll ..\src\drivers\win\lua\x64\lua51.dll ..\src\auxlib.lua ..\src\drivers\win\7z_64.dll
@if ERRORLEVEL 1 goto end
if %ERRORLEVEL% NEQ 0 EXIT /B 1
..\vc\zip -X -9 -u -r ..\vc\%ZIP_FILENAME% fceux.chm taseditor.chm palettes luaScripts tools
@if ERRORLEVEL 1 goto end
if %ERRORLEVEL% NEQ 0 EXIT /B 1

cd %PROJECT_ROOT%

Expand Down
12 changes: 11 additions & 1 deletion src/drivers/Qt/AviRecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1319,9 +1319,14 @@ static AVFrame *alloc_audio_frame(const AVCodecContext *c,
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100)
static int select_audio_channel_layout(const OutputStream *ost, const AVCodec *codec, AVChannelLayout *dst)
{
int best_nb_channels = 0;
const AVChannelLayout *p, *best_ch_layout;
#if __cplusplus >= 202002L
const AVChannelLayout defaultLayout = AV_CHANNEL_LAYOUT_MONO;
int best_nb_channels = 0;
#else
const AVChannelLayout defaultLayout;
av_channel_layout_from_mask( &defaultLayout, AV_CH_LAYOUT_MONO );
#endif

if (!codec->ch_layouts)
{
Expand Down Expand Up @@ -1505,7 +1510,12 @@ static int initAudioStream( const char *codec_name, OutputStream *ost )
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
av_opt_set_int(ost->swr_ctx, "in_channel_layout", AV_CH_LAYOUT_MONO, 0);
#else
#if __cplusplus >= 202002L
AVChannelLayout src_ch_layout = AV_CHANNEL_LAYOUT_MONO;
#else
AVChannelLayout src_ch_layout;
av_channel_layout_from_mask( &src_ch_layout, AV_CH_LAYOUT_MONO );
#endif
av_opt_set_chlayout(ost->swr_ctx, "in_chlayout", &src_ch_layout, 0);
#endif
av_opt_set_sample_fmt(ost->swr_ctx, "out_sample_fmt", c->sample_fmt, 0);
Expand Down

0 comments on commit 8a59bd3

Please sign in to comment.