Comments (4)
We're aware of the opus_compare.c issue and it's a WONTFIX. That file is part of the standard for testing Opus compliance so we're not changing it at all unless something really bad gets discovered. When it comes to opus_demo, it would be good to have a less repetitive patch (maybe using goto?) to merge.
from opus.
Seems odd to leave known issues unfixed in test code, but okay.
I’m not allowed to post patches to other projects without internal review, so this bug report documents the issue. You’re free to take the existing patch and use it, modify it or fix it a different way. I’m not a huge fan of goto statements, anyway. :)
from opus.
About opus_compare.c, let's just say that it's as much of a contract and political statement as it is software, so any change to it makes some people nervous. As for opus_demo.c, can you have a look at this goto-based patch I made and give it a try?
https://jmvalin.ca/misc_stuff/fix_opus_demo_leaks.patch
As much as I also hate gotos in general, I think this is the one use case, where it's cleaner than alternatives. I believe it also addresses a case that your patch missed (exiting on opus_decoder_create() would fail to destroy the encoder)
from opus.
Okay, will try to do a code review here.
-static void check_encoder_option(int decode_only, const char *opt)
-{
- if (decode_only)
- {
- fprintf(stderr, "option %s is only for encoding\n", opt);
- exit(EXIT_FAILURE);
- }
-}
+#define check_encoder_option(decode_only, opt) do {if (decode_only) {fprintf(stderr, "option %s is only for encoding\n", opt); goto failure;}} while(0)
I would find the macro much easier to read if it were formatted like regular code with line continuation backslashes at the end of each line:
+#define check_encoder_option(decode_only, opt) \
+do { \
+ if (decode_only) { \
+ fprintf(stderr, "option %s is only for encoding\n", opt); \
+ goto failure; \
+ } \
+} while(0)
Also learned that calling free(NULL) is okay. (Didn't realize that!)
Patch looks good to me other than the readability of check_encoder_option() macro.
from opus.
Related Issues (20)
- opus_repacketizer_cat sometimes fails
- Limiting the stack allocation request HOT 2
- Please update opus-tools to support new features
- Deep PLC performance on Android HOT 16
- Compiling with CMake for Windows/MSVC only supports DLL runtime libraries HOT 9
- Added the OPUS_SET_INBAND_FEC(2) option HOT 1
- Please provide an option to not depend on downloading model data HOT 10
- v1.5.2 compile warnings
- Error: Range coder state mismatch between encoder and decoder in frame 1: 0x f3b1240 vs 0x40123b0f HOT 1
- Opus.lib: 1.3.1 version crashing in some windows machines in opus_encoder_create HOT 2
- Opus 1.5.x and main compilation failing with GCC 8.5.0 HOT 1
- Opus not building on Ubuntu 24.04
- No way to turn off the PLC/FEC?
- Floating Point libraries failing to build when targeting Fixed Point support only. MSVC 2017 v141 HOT 3
- Unexpected continuous noise when combining NoLACE with DTX HOT 9
- Bug: The decoded dred_offset < 0 HOT 1
- How can I verify if FEC is working? I am not hearing any changes with fec enabled vs disabled with 30% packet loss HOT 2
- Cannot build because media.xiph.org is not responding HOT 3
- FTBFS with "fixed-point" and Deep PLC
- Libopus does not encode 5.1ch(side) / data loss when encoding from 5.1 ch -> 5.1(side) ch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opus.