* Fix -Wunused-result warnings
* Wrap checked writes into a function
* In write_wrapped, continue writing in case of partial write
If a partial write occurs, it doesn't necessarily mean that something
failed, according to write(2). If this is the case, then the following
write will return -1.
* Fix build on MSVC
https://stackoverflow.com/questions/37460579/error-c2036-void-unknown-size
Expands the Windows build steps to include DLL's in the artifact, making an out-of-box use of said artifacts easier. The new artifacts will allow running ccextractor (not the GUI yet) directly.
Improves the build for 32 bit variants.
Contains fixes:
- `/SAFESEH:NO`: needed for linking precompiled ffmpeg-lib libraries
- add paths from $(ProjectDir)libs\lib\ffmpeg-lib and avcodec.lib; avformat.lib; avutil.lib; swscale.lib
- add extra post-build actions to copy libraries
- add $(vcpkg) paths
Adds a (likely non-working) build stage for building with OCR to the Windows GitHub actions, so we can assure that Windows keeps building with OCR just fine.
Makes a small update to the ISSUE_TEMPLATE to clarify instructions for sending samples that cannot be made public.
Co-authored-by: Willem <github@canihavesome.coffee>
* [ISSUE_TEMPLATE.md] Comment out instructions
* [PULL_REQUEST_TEMPLATE.md] Comment out instructions
* Mention in ISSUE_TEMPLATE.md that only useful arguments should be put
* Follow feedback
This was caused by 19241744d7, moving from
`unsigned char` to `enums` for colors and fonts. The problem with this is
that each colour isn't one byte next to each other so memcpy and memset
didn't work anymore.
The problem:
```patch
6812,6813c6812,6813
< EDITION OF AMERICA'S NEXT TOP
< <i> MODEL</i> ON WEDNESDAYS.<i> </i>
---
> EDITION OF<i> AMERICA'S NEXT TOP</i>
> <i> MODEL</i> ON WEDNESDAYS.
6817c6817
< EDITION OF AMERICA'S NEXT TOP
---
> EDITION OF<i> AMERICA'S NEXT TOP</i>
6819c6819
< >><i> THE VAMPIRE DIARIES </i>
---
> >><i> THE VAMPIRE DIARIES</i>
6824,6825c6824,6825
< >><i> THE VA</i>MPIRE DIARIES
< AND<i> THE SECRET CIRCLE </i>
---
> >><i> THE VAMPIRE DIARIES</i>
> AND<i> THE SECRET CIRCLE</i>
6829,6831c6829,6831
< >><i> THE VA</i>MPIRE DIARIES
< AND<i> THE S</i>ECRET CIRCLE
< ON THURSDAYS.<i> </i>
---
> >><i> THE VAMPIRE DIARIES</i>
> AND<i> THE SECRET CIRCLE</i>
> ON THURSDAYS.
6835c6835
< AND<i> THE S</i>ECRET CIRCLE
---
> AND<i> THE SECRET CIRCLE</i>
```
* Add .clang-format
* Add clang-format github action
* Set more explicit name to GitHub workflow
Co-Authored-By: Willem <github@canihavesome.coffee>
Co-authored-by: Willem <github@canihavesome.coffee>
* file_buffer: Fix unitialized variable usage warning
Clang warns:
In file included from src/lib_ccx/asf_functions.c:5:
src/lib_ccx/file_buffer.h:76:7: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (buffer)
^~~~~~
src/lib_ccx/file_buffer.h:86:9: note: uninitialized use occurs here
return result;
^~~~~~
src/lib_ccx/file_buffer.h:76:3: note: remove the 'if' if its condition is always true
if (buffer)
^~~~~~~~~~~
src/lib_ccx/file_buffer.h:73:15: note: initialize the variable 'result' to silence this warning
size_t result;
^
= 0
* common_timing: Fix uninitialized variable usage warning
The vast majority of the code is already using fatal(), so I don't see
why this should be an exception.
Clang warns:
src/lib_ccx/ccx_common_timing.c:274:3: warning: variable 'fts' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
src/lib_ccx/ccx_common_timing.c:280:9: note: uninitialized use occurs here
return fts;
^~~
src/lib_ccx/ccx_common_timing.c:261:11: note: initialize the variable 'fts' to silence this warning
LLONG fts;
^
= 0
* encoders: Fix handling of multibyte characters in UTF-8 converter
This is actually incorrect because characters longer than 1 byte will be
butchered.
Clang warns:
src/lib_ccx/ccx_encoders_common.c:178:12: warning: result of comparison of constant 256 with expression of
type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare]
if (c < 256)
~ ^ ~~~
src/lib_ccx/ccx_encoders_common.c:193:12: warning: result of comparison of constant 256 with expression of
type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare]
if (c < 256)
~ ^ ~~~
src/lib_ccx/ccx_encoders_common.c:209:12: warning: result of comparison of constant 256 with expression of
type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare]
if (c < 256)
~ ^ ~~~
src/lib_ccx/ccx_encoders_common.c:229:12: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare]
if (c < 256)
~ ^ ~~~
* gxf: Fix tautological comparison warnings
Clang warns:
src/lib_ccx/ccx_gxf.c:425:17: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always false [-Wtautological-constant-out-of-range-compare]
if (tag_len > STR_LEN)
~~~~~~~ ^ ~~~~~~~
src/lib_ccx/ccx_gxf.c:542:17: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always false [-Wtautological-constant-out-of-range-compare]
if (tag_len > STR_LEN)
~~~~~~~ ^ ~~~~~~~
src/lib_ccx/ccx_gxf.c:617:17: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always false [-Wtautological-constant-out-of-range-compare]
if (tag_len > STR_LEN)
~~~~~~~ ^ ~~~~~~~
* gxf: Fix uninitialized variable usage warnings
Clang warns:
src/lib_ccx/ccx_gxf.c:1449:8: warning: variable 'first_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case TRACK_TYPE_MPEG1_525:
^~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1475:35: note: uninitialized use occurs here
debug("first field number %d\n", first_field_nb);
^~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1450:8: warning: variable 'first_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case TRACK_TYPE_MPEG2_525:
^~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1475:35: note: uninitialized use occurs here
debug("first field number %d\n", first_field_nb);
^~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1456:3: warning: variable 'first_field_nb' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
src/lib_ccx/ccx_gxf.c:1475:35: note: uninitialized use occurs here
debug("first field number %d\n", first_field_nb);
^~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1410:30: note: initialize the variable 'first_field_nb' to silence this warning
unsigned char first_field_nb;
^
= '\0'
src/lib_ccx/ccx_gxf.c:1449:8: warning: variable 'last_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case TRACK_TYPE_MPEG1_525:
^~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1476:34: note: uninitialized use occurs here
debug("last field number %d\n", last_field_nb);
^~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1450:8: warning: variable 'last_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case TRACK_TYPE_MPEG2_525:
^~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1476:34: note: uninitialized use occurs here
debug("last field number %d\n", last_field_nb);
^~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1456:3: warning: variable 'last_field_nb' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
src/lib_ccx/ccx_gxf.c:1476:34: note: uninitialized use occurs here
debug("last field number %d\n", last_field_nb);
^~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1411:29: note: initialize the variable 'last_field_nb' to silence this warning
unsigned char last_field_nb;
^
= '\0'
* ts_functions: Fix incorrect enumeration type in get_buffer_type
Clang warns:
src/lib_ccx/ts_functions.c:127:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_PES;
~~~~~~ ^~~~~~~
src/lib_ccx/ts_functions.c:131:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_H264;
~~~~~~ ^~~~~~~~
src/lib_ccx/ts_functions.c:135:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_DVB_SUBTITLE;
~~~~~~ ^~~~~~~~~~~~~~~~
src/lib_ccx/ts_functions.c:139:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_ISDB_SUBTITLE;
~~~~~~ ^~~~~~~~~~~~~~~~~
src/lib_ccx/ts_functions.c:143:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_HAUPPAGE;
~~~~~~ ^~~~~~~~~~~~
src/lib_ccx/ts_functions.c:147:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_TELETEXT;
~~~~~~ ^~~~~~~~~~~~
src/lib_ccx/ts_functions.c:151:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_PRIVATE_MPEG2_CC;
~~~~~~ ^~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ts_functions.c:155:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_PES;
~~~~~~ ^~~~~~~
src/lib_ccx/ts_functions.c:491:24: warning: implicit conversion from enumeration type 'enum ccx_stream_type' to different enumeration type 'enum ccx_bufferdata_type' [-Wenum-conversion]
ptr->bufferdatatype = get_buffer_type(cinfo);
~ ^~~~~~~~~~~~~~~~~~~~~~
* utility: Fix tautological comparison warnings
Clang warns:
src/lib_ccx/utility.c:605:24: warning: result of comparison of constant 65536 with expression of type 'unsigned short' is always true [-Wtautological-constant-out-of-range-compare]
} else if (utf16_char < 0x010000) {
~~~~~~~~~~ ^ ~~~~~~~~
src/lib_ccx/utility.c:610:24: warning: result of comparison of constant 1114112 with expression of type 'unsigned short' is always true [-Wtautological-constant-out-of-range-compare]
} else if (utf16_char < 0x110000) {
~~~~~~~~~~ ^ ~~~~~~~~
* ocr: Fix floating point -> integer abs() warning
Clang warns:
src/lib_ccx/ocr.c:529:8: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
if(abs(h-h0)>50) // Color has changed
^
src/lib_ccx/ocr.c:529:8: note: use function 'fabsf' instead
if(abs(h-h0)>50) // Color has changed
^~~
fabsf
src/lib_ccx/ocr.c:529:8: note: include the header <math.h> or explicitly provide a declaration for 'fabsf'
* encoders: Fix incorrect string types when EIA-608 is in use
Clang warns:
src/lib_ccx/ccx_encoders_helpers.c: In function ‘clever_capitalize’:
src/lib_ccx/ccx_encoders_helpers.c:186:4: warning: case label value exceeds maximum value for type
186 | case 0x89: // This is a transparent space
| ^~~~
* ocr: Fix implicit struct declaration warning
Clang warns:
In file included from src/lib_ccx/dvd_subtitle_decoder.c:10:
src/lib_ccx/ocr.h:18:54: warning: ‘struct encoder_ctx’ declared inside parameter list will not be visible outside of this definition or declaration
18 | char *paraof_ocrtext(struct cc_subtitle *sub, struct encoder_ctx *context);
| ^~~~~~~~~~~
All the SCC and CCD examples I can find have CRLF line endings. VLC and
libavformat (used by MPV) don't care, so just go with the popular
convention and switch to CRLF. There's no reason a user would want to
choose their line endings in this scenario.
It now returns a value like the rest of the printf family. It doesn't
brute force the amount of memory that needs to be allocated.
It also removes a warning.
I do not believe there should be any performance concerns with this
implementation as it is what `glibc` does:
https://code.woboq.org/userspace/glibc/libio/iovdprintf.c.html
* cea708: Fix missing new line in log message
* subtype: Remove unused CC_708 type
CEA-708 inputs are coerced to CC_608 before hitting encode_sub.
GCC warns:
src/lib_ccx/ccx_encoders_common.c: In function ‘encode_sub’:
src/lib_ccx/ccx_encoders_common.c:1119:2: warning: enumeration value ‘CC_708’ not handled in switch [-Wswitch]
1119 | switch (sub->type)
| ^~~~~~
* build: Disable pointer-sign warning
This warning triggers all over the codebase due to the widespread use of
unsigned char arrays for parsed subtitle strings and them being passed
to string functions that expect signed ones. Since this won't actually
cause issues, silence the warning across the entire codebase.
* splitbysentence: Fix warnings
GCC warns:
src/lib_ccx/ccx_encoders_splitbysentence.c: In function ‘sbs_is_pointer_on_sentence_breaker’:
src/lib_ccx/ccx_encoders_splitbysentence.c:170:7: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
170 | char p = *(current - 1);
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c: In function ‘sbs_find_insert_point_partial’:
src/lib_ccx/ccx_encoders_splitbysentence.c:231:1: warning: multi-line comment [-Wcomment]
231 | // sprintf(fmtbuf, "SBS: sbs_find_insert_point_partial: compare\n\
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c:263:1: warning: multi-line comment [-Wcomment]
263 | // LOG_DEBUG("SBS: sbs_find_insert_point_partial: LEFT CHANGED,\n\tbuf:[%s]\n\tstr:[%s]\n\
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c:297:1: warning: multi-line comment [-Wcomment]
297 | // sprintf(fmtbuf, "SBS: sbs_find_insert_point_partial: REPLACE ENTIRE TAIL !!\n\
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c:222:6: warning: unused variable ‘i’ [-Wunused-variable]
222 | int i; // top level indexer for strings
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c: In function ‘reformat_cc_bitmap_through_sentence_buffer’:
src/lib_ccx/ccx_encoders_splitbysentence.c:730:8: warning: unused variable ‘str’ [-Wunused-variable]
730 | char *str;
| ^~~
src/lib_ccx/ccx_encoders_splitbysentence.c:729:6: warning: unused variable ‘i’ [-Wunused-variable]
729 | int i = 0;
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c:728:6: warning: unused variable ‘used’ [-Wunused-variable]
728 | int used;
| ^~~~
src/lib_ccx/ccx_encoders_splitbysentence.c:727:18: warning: unused variable ‘ms_end’ [-Wunused-variable]
727 | LLONG ms_start, ms_end;
| ^~~~~~
src/lib_ccx/ccx_encoders_splitbysentence.c:727:8: warning: unused variable ‘ms_start’ [-Wunused-variable]
727 | LLONG ms_start, ms_end;
| ^~~~~~~~
src/lib_ccx/ccx_encoders_splitbysentence.c:726:20: warning: unused variable ‘rect’ [-Wunused-variable]
726 | struct cc_bitmap* rect;
| ^~~~
* spupng: Fix warnings
GCC warns:
src/lib_ccx/ccx_encoders_spupng.c: In function ‘init_face’:
src/lib_ccx/ccx_encoders_spupng.c:644:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
644 | if (error = FT_New_Face(ft_library, font, 0, face))
| ^~~~~
src/lib_ccx/ccx_encoders_spupng.c:651:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
651 | if (error = FT_Set_Pixel_Sizes(*face, 0, FONT_SIZE))
| ^~~~~
src/lib_ccx/ccx_encoders_spupng.c: In function ‘spupng_export_string2png’:
src/lib_ccx/ccx_encoders_spupng.c:698:7: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
698 | if (error = FT_Init_FreeType(&ft_library))
| ^~~~~
src/lib_ccx/ccx_encoders_spupng.c:706:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
706 | if (error = init_face(&face_regular, ccx_options.enc_cfg.render_font))
| ^~~~~
src/lib_ccx/ccx_encoders_spupng.c:708:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
708 | if (error = init_face(&face_italics, ccx_options.enc_cfg.render_font_italics))
| ^~~~~
src/lib_ccx/ccx_encoders_spupng.c:850:9: warning: unused variable ‘height’ [-Wunused-variable]
850 | int height = slot->bitmap.rows;
| ^~~~~~
src/lib_ccx/ccx_encoders_spupng.c:849:9: warning: unused variable ‘width’ [-Wunused-variable]
849 | int width = slot->bitmap.width;
| ^~~~~
src/lib_ccx/ccx_encoders_webvtt.c: In function ‘write_webvtt_header’:
src/lib_ccx/ccx_encoders_webvtt.c:263:1: warning: control reaches end of non-void function [-Wreturn-type]
263 | }
| ^
* webvtt: Fix missing return warning
The return value of this function is never used, so just drop the
values.
GCC warns:
src/lib_ccx/ccx_encoders_webvtt.c: In function ‘write_webvtt_header’:
src/lib_ccx/ccx_encoders_webvtt.c:263:1: warning: control reaches end of non-void function [-Wreturn-type]
263 | }
| ^
* gxf: Fix MIN macro redefinition warning
GCC warns:
src/lib_ccx/ccx_gxf.c:23: warning: "MIN" redefined
23 | #define MIN(a, b) ( (a < b) ? a : b)
|
In file included from src/lib_ccx/ccx_demuxer.h:8,
from src/lib_ccx/ccx_gxf.h:4,
from src/lib_ccx/ccx_gxf.c:13:
src/lib_ccx/utility.h:8: note: this is the location of the previous definition
8 | #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
|
* dvd: Fix unused variable warnings
GCC warns:
src/lib_ccx/dvd_subtitle_decoder.c: In function ‘get_bitmap’:
src/lib_ccx/dvd_subtitle_decoder.c:133:9: warning: unused variable ‘discard’ [-Wunused-variable]
133 | int discard = get_bits(ctx, &nextbyte, &pos, &m);
| ^~~~~~~
src/lib_ccx/dvd_subtitle_decoder.c:172:9: warning: unused variable ‘discard’ [-Wunused-variable]
172 | int discard = get_bits(ctx, &nextbyte, &pos, &m);
| ^~~~~~~
src/lib_ccx/dvd_subtitle_decoder.c: In function ‘write_dvd_sub’:
src/lib_ccx/dvd_subtitle_decoder.c:320:6: warning: unused variable ‘ret’ [-Wunused-variable]
320 | int ret =0;
| ^~~
* es_functions: Fix unused variable warning
This also removes the stale commented code that used this variable.
GCC warns:
src/lib_ccx/es_functions.c: In function ‘read_pic_info’:
src/lib_ccx/es_functions.c:682:7: warning: unused variable ‘frame_type_to_char’ [-Wunused-variable]
682 | char frame_type_to_char[] = { '?', 'I', 'P','B', 'D', '?', '?','?' };
| ^~~~~~~~~~~~~~~~~~
* dvb: Fix unused variable warning when OCR is disabled
GCC warns:
src/lib_ccx/dvb_subtitle_decoder.c: In function ‘write_dvb_sub’:
src/lib_ccx/dvb_subtitle_decoder.c:1509:6: warning: unused variable ‘ret’ [-Wunused-variable]
1509 | int ret = 0;
| ^~~
* general_loop: Fix warnings
GCC warns:
src/lib_ccx/general_loop.c: In function ‘general_loop’:
src/lib_ccx/general_loop.c:1113:15: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
1113 | (enc_ctx && (enc_ctx->srt_counter || enc_ctx->cea_708_counter) ||
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At top level:
src/lib_ccx/general_loop.c:25:28: warning: ‘DO_NOTHING’ defined but not used [-Wunused-const-variable=]
25 | const static unsigned char DO_NOTHING[] = {0x80, 0x80};
| ^~~~~~~~~~
* networking: Fix unknown pragma warning for non-MSVC compilers
GCC warns:
src/lib_ccx/networking.c:22: warning: ignoring #pragma warning [-Wunknown-pragmas]
22 | #pragma warning( suppress : 4005)
|
* networking: Fix unused variable warnings on non-Windows platforms
GCC warns:
src/lib_ccx/networking.c: In function ‘net_udp_read’:
src/lib_ccx/networking.c:342:12: warning: variable ‘addr’ set but not used [-Wunused-but-set-variable]
342 | in_addr_t addr;
| ^~~~
src/lib_ccx/networking.c:340:12: warning: unused variable ‘len’ [-Wunused-variable]
340 | socklen_t len = sizeof(source_addr);
| ^~~
src/lib_ccx/networking.c:338:7: warning: unused variable ‘ip’ [-Wunused-variable]
338 | char ip[INET_ADDRSTRLEN];
| ^~
* params: Fix unused variable warning when OCR is disabled
GCC warns:
src/lib_ccx/params.c: In function ‘version’:
src/lib_ccx/params.c:1015:8: warning: unused variable ‘leptversion’ [-Wunused-variable]
1015 | char *leptversion;
| ^~~~~~~~~~~
* params_dump: Fix empty encoding when ASCII is used
GCC warns:
src/lib_ccx/params_dump.c: In function ‘params_dump’:
src/lib_ccx/params_dump.c:110:2: warning: enumeration value ‘CCX_ENC_ASCII’ not handled in switch [-Wswitch]
110 | switch (ccx_options.enc_cfg.encoding)
| ^~~~~~
* params_dump: Fix comparison between mismatching enums
GCC warns:
src/lib_ccx/params_dump.c: In function ‘print_file_report’:
src/lib_ccx/params_dump.c:402:18: warning: comparison between ‘enum ccx_stream_type’ and ‘enum ccx_stream_mode_enum’ [-Wenum-compare]
402 | (info->stream == CCX_SM_TRANSPORT ||
| ^~
src/lib_ccx/params_dump.c:403:18: warning: comparison between ‘enum ccx_stream_type’ and ‘enum ccx_stream_mode_enum’ [-Wenum-compare]
403 | info->stream == CCX_SM_PROGRAM ||
| ^~
src/lib_ccx/params_dump.c:404:18: warning: comparison between ‘enum ccx_stream_type’ and ‘enum ccx_stream_mode_enum’ [-Wenum-compare]
404 | info->stream == CCX_SM_ASF ||
| ^~
src/lib_ccx/params_dump.c:405:18: warning: comparison between ‘enum ccx_stream_type’ and ‘enum ccx_stream_mode_enum’ [-Wenum-compare]
405 | info->stream == CCX_SM_WTV))
| ^~
* telxcc: Fix unused variable warning
GCC warns:
src/lib_ccx/telxcc.c: In function ‘process_telx_packet’:
src/lib_ccx/telxcc.c:928:10: warning: unused variable ‘flag_subtitle’ [-Wunused-variable]
928 | uint8_t flag_subtitle;
| ^~~~~~~~~~~~~
* ts_functions: Fix unused variable warnings
GCC warns:
src/lib_ccx/ts_functions.c: In function ‘get_pts’:
src/lib_ccx/ts_functions.c:642:11: warning: variable ‘pes_packet_length’ set but not used [-Wunused-but-set-variable]
642 | uint16_t pes_packet_length;
| ^~~~~~~~~~~~~~~~~
src/lib_ccx/ts_functions.c:641:10: warning: variable ‘pes_stream_id’ set but not used [-Wunused-but-set-variable]
641 | uint8_t pes_stream_id;
| ^~~~~~~~~~~~~
* ts_tables_epg: Fix warnings
GCC warns:
src/lib_ccx/ts_tables_epg.c: In function ‘EPG_add_event’:
src/lib_ccx/ts_tables_epg.c:380:6: warning: unused variable ‘isnew’ [-Wunused-variable]
380 | int isnew=true, j;
| ^~~~~
src/lib_ccx/ts_tables_epg.c: In function ‘EPG_DVB_decode_string’:
src/lib_ccx/ts_tables_epg.c:469:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
469 | int ret=-1;
| ^~~
src/lib_ccx/ts_tables_epg.c: In function ‘EPG_ATSC_decode_EIT’:
src/lib_ccx/ts_tables_epg.c:802:25: warning: variable ‘emt_location’ set but not used [-Wunused-but-set-variable]
802 | uint8_t title_length, emt_location;
| ^~~~~~~~~~~~
src/lib_ccx/ts_tables_epg.c:764:10: warning: variable ‘table_id’ set but not used [-Wunused-but-set-variable]
764 | uint8_t table_id;
| ^~~~~~~~
src/lib_ccx/ts_tables_epg.c: In function ‘EPG_ATSC_decode_VCT’:
src/lib_ccx/ts_tables_epg.c:837:10: warning: variable ‘table_id’ set but not used [-Wunused-but-set-variable]
837 | uint8_t table_id;
| ^~~~~~~~
src/lib_ccx/ts_tables_epg.c: In function ‘EPG_DVB_decode_EIT’:
src/lib_ccx/ts_tables_epg.c:883:10: warning: variable ‘segment_last_section_number’ set but not used [-Wunused-but-set-variable]
883 | uint8_t segment_last_section_number;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ts_tables_epg.c:882:10: warning: variable ‘last_section_number’ set but not used [-Wunused-but-set-variable]
882 | uint8_t last_section_number;
| ^~~~~~~~~~~~~~~~~~~
src/lib_ccx/ts_tables_epg.c: In function ‘parse_EPG_packet’:
src/lib_ccx/ts_tables_epg.c:1041:11: warning: unused variable ‘transport_error_indicator’ [-Wunused-variable]
1041 | unsigned transport_error_indicator = (tspacket[1]&0x80)>>7;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
* matroska: Fix unused variable warning
The call is left alone since it might create a decoder context.
GCC warns:
src/lib_ccx/matroska.c: In function ‘matroska_save_all’:
src/lib_ccx/matroska.c:1182:27: warning: unused variable ‘dec_ctx’ [-Wunused-variable]
1182 | struct lib_cc_decode *dec_ctx = update_decoder_list(mkv_ctx->ctx);
| ^~~~~~~
* utility: Only define MIN when necessary
GCC warns:
In file included from src/lib_ccx/ccx_demuxer.h:8,
from src/lib_ccx/lib_ccx.h:15,
from src/gpacmp4/mp4.c:6:
src/lib_ccx/utility.h:8: warning: "MIN" redefined
8 | #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
|
In file included from src/gpacmp4/gpac/tools.h:33,
from src/gpacmp4/gpac/isomedia.h:50,
from src/gpacmp4/mp4.c:5:
src/gpacmp4/gpac/setup.h:324: note: this is the location of the previous definition
324 | #define MIN(X, Y) ((X)<(Y)?(X):(Y))
|
* Implement subtitle modification for all 608 encoders
This is done by modifying the subtitles in `ccx_encoders_common.c`
rather than per encoder.
* Use `char *` instead of subtitle data to capitalize
* Implement subtitle modification for OCR encoders
* Remove signness warnings
* Remove two-word profanity
They do not work for the moment
* Deal with different encoding
* Mention in changelog