Skip to content

Commit aa75eb3

Browse files
committed
fix hd-rum-transcode crash
since recent rewrite (17th Mar, commit 4def13b, pushed to master on Fri), simple: `hd-rumtranscode 8M 5004` crashed with: `Invalid bitrate value -3 passed (either positive bitrate or magic values from -2 supported)!` because RATE_DEFAULT is dispatched in main but not otherwise. In the different contexts, RATE_DEFAULT is invalid so it must not be the default init in VRXTX_INIT initializer.
1 parent 71e8c1e commit aa75eb3

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/host.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ void set_audio_delay(int val);
119119
#define RATE_AUTO (-1) ///< spread packets evenly across frame time (currently 3/4)
120120
#define RATE_DYNAMIC (-2) ///< same as @ref RATE_AUTO but occasional excess frame allowed
121121
#define RATE_MIN RATE_DYNAMIC
122-
#define RATE_DEFAULT (-3) ///< imaginary value, must not be passed to transmit module
123122
#define RATE_FLAG_FIXED_RATE (1ll<<62ll) ///< use the bitrate as fixed, not capped
124123

125124
struct init_data;

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ constexpr char MOD_NAME[] = "[main] ";
127127

128128
constexpr char DEFAULT_AUDIO_CODEC[] = "PCM";
129129
constexpr int PORT_BASE = 5004;
130+
#define RATE_DEFAULT \
131+
(-3) ///< imaginary value, must not be passed to transmit module
130132

131133
constexpr int OPT_AUDIO_CAPTURE_CHANNELS = ('a' << 8) | 'c';
132134
constexpr int OPT_AUDIO_DELAY = ('A' << 8) | 'D';

src/video_rxtx.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ struct vrxtx_params {
8686
.rx_port = -1, \
8787
.tx_port = -1, \
8888
.fec = "none", \
89-
.bitrate = RATE_DEFAULT, \
89+
.bitrate = RATE_UNLIMITED, \
9090
.decoder_mode = VIDEO_NORMAL, \
9191
.protocol_opts = "", \
9292
.start_time = 0, \

0 commit comments

Comments
 (0)