Skip to content

Commit 9d14766

Browse files
cfsmp3claude
andcommitted
fix: Use #define instead of const int for VOBSUB_BLOCK_SIZE
MSVC doesn't support variable-length arrays (VLAs). The const int declaration wasn't being treated as a compile-time constant, causing Windows build failure with errors C2057, C2466, C2133. Changed to #define which is a true compile-time constant. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 6f2a73d commit 9d14766

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lib_ccx/matroska.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,7 @@ static void generate_vobsub_timestamp(char *buf, size_t bufsize, ULLONG millisec
14271427
}
14281428

14291429
/* VOBSUB support: Save VOBSUB track to .idx and .sub files */
1430+
#define VOBSUB_BLOCK_SIZE 2048
14301431
static void save_vobsub_track(struct matroska_ctx *mkv_ctx, struct matroska_sub_track *track)
14311432
{
14321433
if (track->sentence_count == 0)
@@ -1504,9 +1505,6 @@ static void save_vobsub_track(struct matroska_ctx *mkv_ctx, struct matroska_sub_
15041505
snprintf(lang_line, sizeof(lang_line), "\nid: %s, index: 0\n", lang_to_use);
15051506
write_wrapped(idx_desc, lang_line, strlen(lang_line));
15061507

1507-
// Block size for alignment (2048 bytes = 0x800)
1508-
const int VOBSUB_BLOCK_SIZE = 2048;
1509-
15101508
// Buffer for PS/PES headers and padding
15111509
unsigned char header_buf[32];
15121510
unsigned char zero_buf[VOBSUB_BLOCK_SIZE];

0 commit comments

Comments
 (0)