mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2025-01-13 13:40:54 +00:00
[FIX] SCC character pair writing (#1210)
* scc: Fix character pair writing The space was being inserted in the wrong position, so the first character of each caption was being cut off. The last character was also cut off in captions with even lengths. Reported-By: Nils ANDRÉ-CHANG <nils@nilsand.re> * scc: Apply pair writing to control codes The same mandatory pair logic applies here.
This commit is contained in:
parent
424e67f5f4
commit
a919ef4410
@ -1139,7 +1139,7 @@ void write_character(const int fd, const unsigned char character, const bool dis
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*bytes_written % 2 == 1)
|
||||
if (*bytes_written % 2 == 0)
|
||||
write(fd, " ", 1);
|
||||
|
||||
fdprintf(fd, "%02x", odd_parity(character));
|
||||
@ -1165,7 +1165,7 @@ void write_control_code(const int fd, const unsigned char channel, const enum co
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*bytes_written)
|
||||
if (*bytes_written % 2 == 0)
|
||||
write(fd, " ", 1);
|
||||
|
||||
fdprintf(fd, "%02x%02x", odd_parity(get_first_byte(channel, code)), odd_parity(get_second_byte(code)));
|
||||
|
Loading…
Reference in New Issue
Block a user