static int* unpack_i(int *i) { return i; }
static json_int_t* unpack_I(json_int_t *i) { return i; }
static int * unpack_b(int *b) { return b; }
-static char** unpack_s(char **s) { return s; }
+static const char** unpack_s(const char **s){ return s; }
static json_t** unpack_o(json_t** o) { return o; }
void hb_json_job_scan( hb_handle_t * h, const char * json_job )
dict = hb_value_json(json_job);
int title_index;
- char *path = NULL;
+ const char *path = NULL;
result = json_unpack_ex(dict, &error, 0, "{s:{s:s, s:i}}",
"Source",
hb_value_array_t * filter_list = NULL;
hb_value_t * mux = NULL, * vcodec = NULL;
hb_value_t * acodec_copy_mask = NULL, * acodec_fallback = NULL;
- char * destfile = NULL;
- char * range_type = NULL;
- char * video_preset = NULL, * video_tune = NULL;
- char * video_profile = NULL, * video_level = NULL;
- char * video_options = NULL;
+ const char * destfile = NULL;
+ const char * range_type = NULL;
+ const char * video_preset = NULL, * video_tune = NULL;
+ const char * video_profile = NULL, * video_level = NULL;
+ const char * video_options = NULL;
int subtitle_search_burn = 0;
- char * meta_name = NULL, * meta_artist = NULL;
- char * meta_album_artist = NULL, * meta_release = NULL;
- char * meta_comment = NULL, * meta_genre = NULL;
- char * meta_composer = NULL, * meta_desc = NULL;
- char * meta_long_desc = NULL;
+ const char * meta_name = NULL, * meta_artist = NULL;
+ const char * meta_album_artist = NULL, * meta_release = NULL;
+ const char * meta_comment = NULL, * meta_genre = NULL;
+ const char * meta_composer = NULL, * meta_desc = NULL;
+ const char * meta_long_desc = NULL;
json_int_t range_start = -1, range_end = -1, range_seek_points = -1;
int vbitrate = -1;
double vquality = HB_INVALID_VIDEO_QUALITY;
for (ii = 0; ii < count; ii++)
{
chapter_dict = hb_value_array_get(chapter_list, ii);
- char *name = NULL;
+ const char *name = NULL;
result = json_unpack_ex(chapter_dict, &error, 0,
"{s:s}", "Name", unpack_s(&name));
if (result < 0)
hb_audio_config_t audio;
hb_value_t *acodec = NULL, *samplerate = NULL, *mixdown = NULL;
hb_value_t *dither = NULL;
+ const char *name = NULL;
hb_audio_config_init(&audio);
result = json_unpack_ex(audio_dict, &error, 0,
"{s:i, s?s, s?o, s?F, s?F, s?o, s?b, s?o, s?o, s?i, s?F, s?F}",
"Track", unpack_i(&audio.in.track),
- "Name", unpack_s(&audio.out.name),
+ "Name", unpack_s(&name),
"Encoder", unpack_o(&acodec),
"Gain", unpack_f(&audio.out.gain),
"DRC", unpack_f(&audio.out.dynamic_range_compression),
audio.out.dither_method = hb_value_get_int(dither);
}
}
+ if (name != NULL && name[0] != 0)
+ {
+ audio.out.name = strdup(name);
+ }
if (audio.in.track >= 0)
{
audio.out.track = ii;
hb_subtitle_config_t sub_config;
int track = -1;
int burn = 0;
- char *srtfile = NULL;
+ const char *srtfile = NULL;
json_int_t offset = 0;
result = json_unpack_ex(subtitle_dict, &error, 0,
strncpy(sub_config.src_filename, srtfile, 255);
sub_config.src_filename[255] = 0;
- char *srtlang = "und";
- char *srtcodeset = "UTF-8";
+ const char *srtlang = "und";
+ const char *srtcodeset = "UTF-8";
result = json_unpack_ex(subtitle_dict, &error, 0,
"{s?b, s?b, s?I, " // Common
"s?{s?s, s?s, s?s}}", // SRT
for (ii = 0; ii < count; ii++)
{
plane_dict = hb_value_array_get(planes, ii);
- char *data = NULL;
+ const char *data = NULL;
int size;
json_result = json_unpack_ex(plane_dict, &error, 0,
"{s:i, s:s}",