name: libsvtav1 inputs: refId: type: string required: true config: type: string required: true runs: using: "composite" steps: - name: Set up GIT shell: cmd run: | git config --global core.autocrlf false git config --global core.eol lf git clone -b ${{ inputs.refId }} https://gitlab.com/AOMediaCodec/SVT-AV1 svtav1 echo -e "From 213854249dc8d69653a9f3281cdd4c2063cd3779 Mon Sep 17 00:00:00 2001\nFrom: Christopher Degawa \nDate: Wed, 10 Aug 2022 13:53:17 -0500\nSubject: [PATCH] copy_input_buffer: only copy metadata if a frame was actaully\n sent\n\nFixes a segfault if EOS was send through the library without zeroing\nout the metadata array\n\nSigned-off-by: Christopher Degawa \n---\n Source/Lib/Encoder/Globals/EbEncHandle.c | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/Source/Lib/Encoder/Globals/EbEncHandle.c b/Source/Lib/Encoder/Globals/EbEncHandle.c\nindex ba5e719a4..fc7a2b1f4 100644\n--- a/Source/Lib/Encoder/Globals/EbEncHandle.c\n+++ b/Source/Lib/Encoder/Globals/EbEncHandle.c\n@@ -4814,11 +4814,12 @@ static void copy_input_buffer(SequenceControlSet* scs, EbBufferHeaderType* dst,\n } else if (pass != ENCODE_FIRST_PASS || copy_frame) {\n // Bypass copy for the unecessary picture in IPPP pass\n // Copy the picture buffer\n- if (src->p_buffer != NULL)\n+ if (src->p_buffer != NULL) {\n copy_frame_buffer(scs, dst->p_buffer, dst_y8b->p_buffer, src->p_buffer, pass);\n- // Copy the metadata array\n- if (svt_aom_copy_metadata_buffer(dst, src->metadata) != EB_ErrorNone)\n- dst->metadata = NULL;\n+ // Copy the metadata array\n+ if (svt_aom_copy_metadata_buffer(dst, src->metadata) != EB_ErrorNone)\n+ dst->metadata = NULL;\n+ }\n }\n \n // Copy the private data list\n-- \nGitLab\n" > segfault.patch cd svt1av1 ; git apply --ignore-whitespace --verbose ../segfault.patch ; cd .. #- name: Checkout SVT AV1 # uses: actions/checkout@v3 # with: # repository: AOMediaCodec/SVT-AV1 # ref: ${{ inputs.refId }} # path: svtav1 - name: Set up MSYS2 uses: msys2/setup-msys2@v2 with: install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm path-type: inherit - name: Build SVT AV1 shell: cmd env: vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\ cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }} run: | call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat" md build build\include build\lib build\lib\pkgconfig dist D:\a\_temp\setup-msys2\msys2.cmd -c 'cd svtav1/Build/windows ; ./build.bat 2022 ${{ inputs.config }} static ; cp -r ../../Source/API ../../../build/include/svt-av1 ; cp ../../Bin/${{ inputs.config }}/SvtAv1Enc.lib ../../../build/lib/ ; cp SvtAv1Enc.pc ../../../build/lib/pkgconfig/ ; cd ../../../build ; tar czf ../dist/libsvtav1.tgz *' - name: Publish artifact uses: actions/upload-artifact@v2 with: name: libsvtav1-${{ runner.os }}-${{ inputs.config }} path: dist/libsvtav1.tgz