summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-06-09 09:09:23 -0600
committerJohn Stebbins <[email protected]>2016-06-09 09:09:23 -0600
commitd10505743b386b2264abe6ef28fcd3b6b2815845 (patch)
tree18a6180a5ad38a0bb92c70965334f88acba27132 /libhb
parent755f2e7c39680cbb867ca95ef135c59079871dbb (diff)
json: fix extraction of negative SRT offsets
Diffstat (limited to 'libhb')
-rw-r--r--libhb/hb_json.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libhb/hb_json.c b/libhb/hb_json.c
index 5bc8e5f50..1df32189f 100644
--- a/libhb/hb_json.c
+++ b/libhb/hb_json.c
@@ -1301,8 +1301,8 @@ hb_job_t* hb_dict_to_job( hb_handle_t * h, hb_dict_t *dict )
{
sub_config = subtitle->config;
result = json_unpack_ex(subtitle_dict, &error, 0,
- "{s?b, s?b, s?b, s?i}",
- "Default", unpack_i(&sub_config.default_track),
+ "{s?b, s?b, s?b, s?I}",
+ "Default", unpack_b(&sub_config.default_track),
"Forced", unpack_b(&sub_config.force),
"Burn", unpack_b(&burn),
"Offset", unpack_I(&offset));
@@ -1325,7 +1325,7 @@ hb_job_t* hb_dict_to_job( hb_handle_t * h, hb_dict_t *dict )
char *srtlang = "und";
char *srtcodeset = "UTF-8";
result = json_unpack_ex(subtitle_dict, &error, 0,
- "{s?b, s?b, s?i, " // Common
+ "{s?b, s?b, s?I, " // Common
"s?{s?s, s?s, s?s}}", // SRT
"Default", unpack_b(&sub_config.default_track),
"Burn", unpack_b(&burn),
@@ -1334,12 +1334,12 @@ hb_job_t* hb_dict_to_job( hb_handle_t * h, hb_dict_t *dict )
"Filename", unpack_s(&srtfile),
"Language", unpack_s(&srtlang),
"Codeset", unpack_s(&srtcodeset));
- if (result < 0)
- {
- hb_error("json unpack failure: %s", error.text);
- hb_job_close(&job);
- return NULL;
- }
+ if (result < 0)
+ {
+ hb_error("json unpack failure: %s", error.text);
+ hb_job_close(&job);
+ return NULL;
+ }
sub_config.offset = offset;
sub_config.dest = burn ? RENDERSUB : PASSTHRUSUB;
strncpy(sub_config.src_codeset, srtcodeset, 39);