From 17346257ec1f5218012260c92f46c2d00cacefba Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 14:47:18 +0100 Subject: [PATCH 01/12] mkvalidator: return an error when the tracks give errors --- mkvalidator/mkvalidator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkvalidator/mkvalidator.c b/mkvalidator/mkvalidator.c index 75a8a635..7d7eeb1f 100644 --- a/mkvalidator/mkvalidator.c +++ b/mkvalidator/mkvalidator.c @@ -1354,7 +1354,7 @@ int main(int argc, const char *argv[]) if (!Quiet) TextWrite(StdErr,T(".")); if (RTrackInfo) - CheckTracks(RTrackInfo, MatroskaProfile); + Result |= CheckTracks(RTrackInfo, MatroskaProfile); for (TI=ARRAYBEGIN(Tracks,track_info); TI!=ARRAYEND(Tracks,track_info); ++TI) { From 1a71b35abac6c875f7380cca17cce865abfa2c27 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 14:47:55 +0100 Subject: [PATCH 02/12] mkclean: report the mkvalidator errors as hexadecimal values Easier to find in the code. --- mkclean/regression/mkcleanreg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkclean/regression/mkcleanreg.py b/mkclean/regression/mkcleanreg.py index a054630f..6bdbc467 100755 --- a/mkclean/regression/mkcleanreg.py +++ b/mkclean/regression/mkcleanreg.py @@ -74,7 +74,7 @@ def testFile(cli, line_num, src_file, mkclean_options, filesize, hash): result = subprocess.run(mkvalidator_run) if not result.returncode == 0: - print(f"Fail:6:{line_num}: mkvalidator returned {result} for {outputfile} in {src_file} for {mkclean_options}", file=sys.stderr) + print(f"Fail:6:{line_num}: mkvalidator returned 0x{result.returncode:03X} for {outputfile} in {src_file} for {mkclean_options}", file=sys.stderr) return filemd5 = hashlib.md5(open(outputfile,'rb').read()).hexdigest() From e75891292272b8c1a0b74ab46ebf0969de062db0 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 15:19:00 +0100 Subject: [PATCH 03/12] libmatroska2: rename CONFIG_CODEC_HELPER helper Not non-negative option isn't not bad. We do want this enabled by default as intended in a49294a186cd2e265e5cb12e6b5a8dbf84c6ac0a. --- libmatroska2/CMakeLists.txt | 6 +++--- libmatroska2/matroska_config.h.in | 2 +- libmatroska2/matroskablock.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libmatroska2/CMakeLists.txt b/libmatroska2/CMakeLists.txt index 4eb705cc..0cec3dfe 100644 --- a/libmatroska2/CMakeLists.txt +++ b/libmatroska2/CMakeLists.txt @@ -3,7 +3,7 @@ project("matroska2" VERSION 0.22.3 LANGUAGES C) option(CONFIG_ZLIB "Enable zlib (de)compression" ON) option(CONFIG_BZLIB "Enable bzlib decompression in libmatroska2" ON) option(CONFIG_LZO1X "Enable lzo decompression in libmatroska2" ON) -option(CONFIG_NOCODEC_HELPER "Enable Vorbis frame durations in libmatroska2" ON) +option(CONFIG_CODEC_HELPER "Enable Vorbis frame durations in libmatroska2" ON) if (CONFIG_ZLIB) include(FindZLIB) @@ -75,10 +75,10 @@ if (CONFIG_BZLIB) endif() endif(CONFIG_BZLIB) -if (NOT CONFIG_NOCODEC_HELPER) +if (CONFIG_CODEC_HELPER) add_subdirectory("tremor") target_link_libraries("matroska2" PRIVATE $) -endif(NOT CONFIG_NOCODEC_HELPER) +endif(CONFIG_CODEC_HELPER) set_target_properties("matroska2" PROPERTIES PUBLIC_HEADER "${matroska2_PUBLIC_HEADERS}" diff --git a/libmatroska2/matroska_config.h.in b/libmatroska2/matroska_config.h.in index 8253e0dd..ccf1fa25 100644 --- a/libmatroska2/matroska_config.h.in +++ b/libmatroska2/matroska_config.h.in @@ -2,7 +2,7 @@ #cmakedefine CONFIG_ZLIB #cmakedefine CONFIG_LZO1X #cmakedefine CONFIG_BZLIB -#cmakedefine CONFIG_NOCODEC_HELPER +#cmakedefine CONFIG_CODEC_HELPER #define LIBMATROSKA2_PROJECT_VERSION T("@matroska2_VERSION_MAJOR@.@matroska2_VERSION_MINOR@.@matroska2_VERSION_PATCH@") #define LIBMATROSKA2_VERSION ((@matroska2_VERSION_MAJOR@ << 24) | (@matroska2_VERSION_MINOR@ << 16) | @matroska2_VERSION_PATCH@) diff --git a/libmatroska2/matroskablock.c b/libmatroska2/matroskablock.c index 3d064a43..3fd45881 100644 --- a/libmatroska2/matroskablock.c +++ b/libmatroska2/matroskablock.c @@ -5,7 +5,7 @@ #include "matroska2/matroska.h" #include "matroska2/matroska_sem.h" #include "matroska2/matroska_classes.h" -#if !defined(CONFIG_NOCODEC_HELPER) +#if defined(CONFIG_CODEC_HELPER) #include "ivorbiscodec.h" #include "codec_internal.h" #include "misc.h" @@ -195,7 +195,7 @@ err_t MATROSKA_BlockProcessFrameDurations(matroska_block *Block, struct stream * } } } -#if !defined(CONFIG_NOCODEC_HELPER) +#if defined(CONFIG_CODEC_HELPER) else if (tcsisame_ascii(CodecID,T("A_VORBIS"))) { Block->IsKeyframe = 1; // safety From e1bf8abb36c70985e5d1f96e04740cb9531a25a3 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 15:26:59 +0100 Subject: [PATCH 04/12] corec: use abs() functions from stdlib.h --- corec/corec/helper.h | 2 -- corec/corec/helpers/parser/parser2.c | 5 +++-- corec/corec/helpers/parser/strtypes.c | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/corec/corec/helper.h b/corec/corec/helper.h index 94c6f349..5239130e 100644 --- a/corec/corec/helper.h +++ b/corec/corec/helper.h @@ -44,8 +44,6 @@ #define STORE32LE(p, i) STORE8(p, 0, i), STORE8(p, 1, ((uint32_t)i) >> 8), STORE8(p, 2, ((uint32_t)i) >> 16), STORE8(p, 3, ((uint32_t)i) >> 24) -#define _abs(a) (((a)>=0)?(a):-(a)) - static INLINE int64_t Scale64(int64_t v,int64_t Num,int64_t Den) { if (Den) diff --git a/corec/corec/helpers/parser/parser2.c b/corec/corec/helpers/parser/parser2.c index d29cf3ca..5025ac85 100644 --- a/corec/corec/helpers/parser/parser2.c +++ b/corec/corec/helpers/parser/parser2.c @@ -5,6 +5,7 @@ * ****************************************************************************/ +#include #include "parser.h" #include "strtypes.h" #include "strtab.h" @@ -977,8 +978,8 @@ void SimplifyFrac(cc_fraction* f, int64_t Num, int64_t Den) { bool_t Sign = (Num<0) != (Den<0); - Num = _abs(Num); - Den = _abs(Den); + Num = llabs(Num); + Den = llabs(Den); if (Num>INT_MAX || Den>INT_MAX) { diff --git a/corec/corec/helpers/parser/strtypes.c b/corec/corec/helpers/parser/strtypes.c index aae049cb..c64e56fc 100644 --- a/corec/corec/helpers/parser/strtypes.c +++ b/corec/corec/helpers/parser/strtypes.c @@ -5,6 +5,7 @@ * ****************************************************************************/ +#include #include "strtypes.h" #include "parser.h" #include @@ -47,7 +48,7 @@ void FractionToString(tchar_t* Out, size_t OutLen, const cc_fraction* p, int Per if (Percent) { - while (_abs(Num) > INT_MAX/100) + while (labs(Num) > INT_MAX/100) { Num >>= 1; Den >>= 1; From 2b47ace82262c906418a057e24736038e94f91b3 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 15:29:14 +0100 Subject: [PATCH 05/12] tremor: use labs() for long values --- libmatroska2/tremor/sharedbook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmatroska2/tremor/sharedbook.c b/libmatroska2/tremor/sharedbook.c index 8e074925..a1126402 100644 --- a/libmatroska2/tremor/sharedbook.c +++ b/libmatroska2/tremor/sharedbook.c @@ -212,7 +212,7 @@ ogg_int32_t *_book_unquantize(const static_codebook *b,int n,int *sparsemap, int index= (j/indexdiv)%quantvals; int point=0; int val=VFLOAT_MULTI(delta,delpoint, - abs(b->quantlist[index]),&point); + labs(b->quantlist[index]),&point); val=VFLOAT_ADD(mindel,minpoint,val,point,&point); val=VFLOAT_ADD(last,lastpoint,val,point,&point); @@ -246,7 +246,7 @@ ogg_int32_t *_book_unquantize(const static_codebook *b,int n,int *sparsemap, for(k=0;kdim;k++){ int point=0; int val=VFLOAT_MULTI(delta,delpoint, - abs(b->quantlist[j*b->dim+k]),&point); + labs(b->quantlist[j*b->dim+k]),&point); val=VFLOAT_ADD(mindel,minpoint,val,point,&point); val=VFLOAT_ADD(last,lastpoint,val,point,&point); From 97de17fed976d138637e9c22c69e5d41abd87321 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 15:30:35 +0100 Subject: [PATCH 06/12] tremor: remove dead code --- libmatroska2/tremor/block.c | 10 ---------- libmatroska2/tremor/info.c | 12 ------------ 2 files changed, 22 deletions(-) diff --git a/libmatroska2/tremor/block.c b/libmatroska2/tremor/block.c index ae6f7d1b..c9038d96 100644 --- a/libmatroska2/tremor/block.c +++ b/libmatroska2/tremor/block.c @@ -26,16 +26,6 @@ #include "registry.h" #include "misc.h" -static int ilog(unsigned int v){ - int ret=0; - if(v)--v; - while(v){ - ret++; - v>>=1; - } - return(ret); -} - /* pcm accumulator examples (not exhaustive): <-------------- lW ----------------> diff --git a/libmatroska2/tremor/info.c b/libmatroska2/tremor/info.c index 6578642d..5a010c06 100644 --- a/libmatroska2/tremor/info.c +++ b/libmatroska2/tremor/info.c @@ -40,18 +40,6 @@ void vorbis_comment_init(vorbis_comment *vc){ memset(vc,0,sizeof(*vc)); } -/* This is more or less the same as strncasecmp - but that doesn't exist - * everywhere, and this is a fairly trivial function, so we include it */ -static int tagcompare(const char *s1, const char *s2, int n){ - int c=0; - while(c < n){ - if(toupper(s1[c]) != toupper(s2[c])) - return !0; - c++; - } - return 0; -} - void vorbis_comment_clear(vorbis_comment *vc){ if(vc){ long i; From f1c68c4cc1b487fd13893e1fd99c2c117fbb6d08 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 15:44:51 +0100 Subject: [PATCH 07/12] libmatroska2: don't include unused tremor header --- libmatroska2/matroskablock.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libmatroska2/matroskablock.c b/libmatroska2/matroskablock.c index 3fd45881..7f77a1f5 100644 --- a/libmatroska2/matroskablock.c +++ b/libmatroska2/matroskablock.c @@ -8,7 +8,6 @@ #if defined(CONFIG_CODEC_HELPER) #include "ivorbiscodec.h" #include "codec_internal.h" -#include "misc.h" #endif #include From 39500922f29bf3b759d315d51a76843cfdd024e6 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 16:05:48 +0100 Subject: [PATCH 08/12] mkclean: update regression file after Vorbis duration fixes --- mkclean/regression/regression.mkc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkclean/regression/regression.mkc b/mkclean/regression/regression.mkc index 25a7dd9a..b5d1b51f 100644 --- a/mkclean/regression/regression.mkc +++ b/mkclean/regression/regression.mkc @@ -148,11 +148,11 @@ "chrome_linux_x64_fail.webm" "--remux --optimize" 138037768 dcdb434ab0c953f5502b84799f09e012 "chrome_linux_x64_fail.webm" "--remux --unsafe" 138036732 fbe72bfdf6bfe463fe7cf67f25572ac2 "A_Digital_Media_Primer_For_Geeks-360p.webm" "" 138041303 560ef9192e79c610d040d7f2b82d0950 -"A_Digital_Media_Primer_For_Geeks-360p.webm" "--remux" 138037140 f8b9a51620b53789cfe2ec69c7cb488f +"A_Digital_Media_Primer_For_Geeks-360p.webm" "--remux" 138037655 a3c59c22899bbcf98120e8eb59fe6106 "A_Digital_Media_Primer_For_Geeks-360p.webm" "--optimize" 138041303 560ef9192e79c610d040d7f2b82d0950 -"A_Digital_Media_Primer_For_Geeks-360p.webm" "--remux --optimize" 138037140 f8b9a51620b53789cfe2ec69c7cb488f +"A_Digital_Media_Primer_For_Geeks-360p.webm" "--remux --optimize" 138037655 a3c59c22899bbcf98120e8eb59fe6106 "A_Digital_Media_Primer_For_Geeks-360p.webm" "--unsafe" 138039084 63c1c373b73312b0bee1d5847957c48b -"A_Digital_Media_Primer_For_Geeks-360p.webm" "--remux --unsafe" 138036104 f00a30e724e67fbcef192668175dfb54 +"A_Digital_Media_Primer_For_Geeks-360p.webm" "--remux --unsafe" 138036619 5289dc5076aa59f010c8b982dad7c478 "fake-side-by-side.webm" "" 138037777 9640e786a92f2ede26b6f45ad70fae62 "fake-side-by-side.webm" "--remux" 138037777 7f13e2640c0f2c0b885e38c9b5313c78 "fake-side-by-side.webm" "--optimize" 138037777 9640e786a92f2ede26b6f45ad70fae62 From 06d400c2704d1d52e3f93c64f8a8ed44b0d36a05 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 15:45:50 +0100 Subject: [PATCH 09/12] mkclean: use tremor to set bogus 0 Hz SamplingFrequency Other codecs could be handled as well. --- mkclean/CMakeLists.txt | 4 ++ mkclean/mkclean.c | 104 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/mkclean/CMakeLists.txt b/mkclean/CMakeLists.txt index a891db6b..61f8128f 100644 --- a/mkclean/CMakeLists.txt +++ b/mkclean/CMakeLists.txt @@ -13,6 +13,10 @@ target_include_directories("mkclean" PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries("mkclean" PUBLIC "matroska2" "ebml2" "corec") +if (CONFIG_CODEC_HELPER) + target_link_libraries("mkclean" PRIVATE $) +endif(CONFIG_CODEC_HELPER) + # Source packaging script configure_file(pkg.sh.in pkg.sh) configure_file(src.br.in src.br) diff --git a/mkclean/mkclean.c b/mkclean/mkclean.c index dac9f15b..b36aba93 100644 --- a/mkclean/mkclean.c +++ b/mkclean/mkclean.c @@ -13,6 +13,10 @@ #include #include +#if defined(CONFIG_CODEC_HELPER) +#include "ivorbiscodec.h" +#endif + #ifndef CONFIG_EBML_WRITING #error libebml2 was not built with writing support! #endif @@ -887,6 +891,87 @@ static bool_t HasTrackUID(ebml_master *Tracks, int TrackUID, const ebml_context return 0; } +static double GuessSamplingFreq(ebml_master *Track) +{ + double SampleRate = 0x0p+0; +#if defined(CONFIG_CODEC_HELPER) + tchar_t CodecID[MAXPATH]; + ebml_element *Elt = EBML_MasterGetChild(Track,MATROSKA_getContextCodecID(),DstProfile); + EBML_StringGet((ebml_string*)Elt,CodecID,TSIZEOF(CodecID)); + if (tcsisame_ascii(CodecID,T("A_VORBIS"))) + { + ebml_binary *CodecPrivate = (ebml_binary*) EBML_MasterFindChild(Track,MATROSKA_getContextCodecPrivate()); + if (CodecPrivate != NULL) + { + vorbis_info vi; + vorbis_comment vc; + ogg_packet OggPacket; + ogg_reference OggRef; + ogg_buffer OggBuffer; + int n,i,j; + + vorbis_info_init(&vi); + vorbis_comment_init(&vc); + memset(&OggPacket,0,sizeof(ogg_packet)); + + OggBuffer.data = (uint8_t*)EBML_BinaryGetData(CodecPrivate); + OggBuffer.size = (long)EBML_ElementDataSize((ebml_element*)CodecPrivate, 1); + OggBuffer.refcount = 1; + + memset(&OggRef,0,sizeof(OggRef)); + OggRef.buffer = &OggBuffer; + OggRef.next = NULL; + + OggPacket.packet = &OggRef; + OggPacket.packetno = -1; + + n = OggBuffer.data[0]; + i = 1+n; + j = 1; + + while (OggPacket.packetno < 3 && n>=j) + { + OggRef.begin = i; + OggRef.length = 0; + do + { + OggRef.length += OggBuffer.data[j]; + } + while (OggBuffer.data[j++] == 255 && n>=j); + i += OggRef.length; + + if (i > OggBuffer.size) + return ERR_INVALID_DATA; + + ++OggPacket.packetno; + OggPacket.b_o_s = OggPacket.packetno == 0; + OggPacket.bytes = OggPacket.packet->length; + if (!(vorbis_synthesis_headerin(&vi,&vc,&OggPacket) >= 0) && OggPacket.packetno==0) + return ERR_INVALID_DATA; + } + + if (OggPacket.packetno < 3) + { + OggRef.begin = i; + OggRef.length = OggBuffer.size - i; + + ++OggPacket.packetno; + OggPacket.b_o_s = OggPacket.packetno == 0; + OggPacket.bytes = OggPacket.packet->length; + + if (!(vorbis_synthesis_headerin(&vi,&vc,&OggPacket) >= 0) && OggPacket.packetno==0) + return ERR_INVALID_DATA; + } + + SampleRate = vi.rate; + vorbis_comment_clear(&vc); + vorbis_info_clear(&vi); + } + } +#endif + return SampleRate; +} + static int CleanTracks(ebml_master *Tracks, int srcProfile, int *dstProfile, ebml_master *Attachments, array *Alternate3DTracks) { ebml_master *Track, *CurTrack, *OtherTrack; @@ -1224,11 +1309,26 @@ static int CleanTracks(ebml_master *Tracks, int srcProfile, int *dstProfile, ebm Elt = EBML_MasterFindChild(CurTrack,MATROSKA_getContextAudio()); if (Elt) { + DisplayH = EBML_MasterGetChild((ebml_master*)Elt,MATROSKA_getContextSamplingFrequency(), DstProfile); + if (EBML_FloatValue((ebml_float*)DisplayH) == 0x0p+0) + { + double SamplingFreq = GuessSamplingFreq(CurTrack); + if (SamplingFreq != 0x0p+0) + { + if (!Quiet) + TextPrintf(StdErr,T("Invalid 0 SamplingFrequency value codec '%s' for profile '%s' in track %d, detected %f\r\n"),CodecID,GetProfileName(*dstProfile),TrackNum,SamplingFreq); + EBML_FloatSetValue((ebml_float*)DisplayH, SamplingFreq); + } + else + { + if (!Quiet) + TextPrintf(StdErr,T("Invalid 0 SamplingFrequency value codec '%s' for profile '%s' in track %d, using the default value\r\n"),CodecID,GetProfileName(*dstProfile),TrackNum); + NodeDelete((node*)CurTrack); + } + } Elt2 = EBML_MasterFindChild((ebml_master*)Elt,MATROSKA_getContextOutputSamplingFrequency()); if (Elt2) { - DisplayH = EBML_MasterFindChild((ebml_master*)Elt,MATROSKA_getContextSamplingFrequency()); - assert(DisplayH!=NULL); if (EBML_FloatValue((ebml_float*)Elt2) == EBML_FloatValue((ebml_float*)DisplayH)) NodeDelete((node*)Elt2); } From 4b0538b721db0894862a07a02037d0d1d4dd1c9e Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 15:50:43 +0100 Subject: [PATCH 10/12] mkclean: silence mkvalidator warnings in quiet mode --- mkclean/regression/mkcleanreg.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mkclean/regression/mkcleanreg.py b/mkclean/regression/mkcleanreg.py index 6bdbc467..e0dced9a 100755 --- a/mkclean/regression/mkcleanreg.py +++ b/mkclean/regression/mkcleanreg.py @@ -65,6 +65,7 @@ def testFile(cli, line_num, src_file, mkclean_options, filesize, hash): mkvalidator_exe = "mkvalidator" mkvalidator_run = [mkvalidator_exe] if cli.quiet: + mkvalidator_run.append("--no-warn") mkvalidator_run.append("--quiet") if '--live' in mkclean_options: mkvalidator_run.append("--live") From 7936e8f6b208ec24725532d2c41725c479959531 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 16:11:12 +0100 Subject: [PATCH 11/12] mkclean: update hash after 0 SamplingFrequency Vorbis is fixed --- mkclean/regression/regression.mkc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mkclean/regression/regression.mkc b/mkclean/regression/regression.mkc index b5d1b51f..38ec19a3 100644 --- a/mkclean/regression/regression.mkc +++ b/mkclean/regression/regression.mkc @@ -143,10 +143,10 @@ "dts-bz2.mkv" "--remux --optimize" 59610381 98d24b3c6e92782b1f8da4f60ab14b45 "dts-bz2.mkv" "--unsafe" 59750039 1d8114732e1f9e0d9cb1fecc9f4dbc64 "dts-bz2.mkv" "--remux --unsafe" 59749650 f868eb64258a40ff3f4b142c25eccd8d -"chrome_linux_x64_fail.webm" "" 138037768 240d01b22ef925f27868efd48470ab63 -"chrome_linux_x64_fail.webm" "--remux" 138037768 dcdb434ab0c953f5502b84799f09e012 -"chrome_linux_x64_fail.webm" "--remux --optimize" 138037768 dcdb434ab0c953f5502b84799f09e012 -"chrome_linux_x64_fail.webm" "--remux --unsafe" 138036732 fbe72bfdf6bfe463fe7cf67f25572ac2 +"chrome_linux_x64_fail.webm" "" 138037768 40890ec7f3541c5148d35c205e9b3458 +"chrome_linux_x64_fail.webm" "--remux" 138037768 82c7609bac30e124612a09da1c238873 +"chrome_linux_x64_fail.webm" "--remux --optimize" 138037768 82c7609bac30e124612a09da1c238873 +"chrome_linux_x64_fail.webm" "--remux --unsafe" 138036732 ca0f5b52200e70b1348e067cb9ad2dcd "A_Digital_Media_Primer_For_Geeks-360p.webm" "" 138041303 560ef9192e79c610d040d7f2b82d0950 "A_Digital_Media_Primer_For_Geeks-360p.webm" "--remux" 138037655 a3c59c22899bbcf98120e8eb59fe6106 "A_Digital_Media_Primer_For_Geeks-360p.webm" "--optimize" 138041303 560ef9192e79c610d040d7f2b82d0950 From b7fb57828dc4fb67842b0776ba890b2bb1dd016e Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 2 Jan 2025 16:18:18 +0100 Subject: [PATCH 12/12] libmatroska2: remove unused min/max macros --- libmatroska2/tremor/os.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libmatroska2/tremor/os.h b/libmatroska2/tremor/os.h index 95e6e27d..cab0895f 100644 --- a/libmatroska2/tremor/os.h +++ b/libmatroska2/tremor/os.h @@ -38,7 +38,7 @@ #ifdef _WIN32 # include -# define rint(x) (floor((x)+0.5f)) +# define rint(x) (floor((x)+0.5f)) # define NO_FLOAT_MATH_LIB # define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b)) # define LITTLE_ENDIAN 1 @@ -53,12 +53,4 @@ # include #endif -#ifndef min -# define min(x,y) ((x)>(y)?(y):(x)) -#endif - -#ifndef max -# define max(x,y) ((x)<(y)?(y):(x)) -#endif - #endif /* _OS_H */