update_title_duration(ud);
ghb_dict_set_int(range, "Start", start * 90000);
- ghb_dict_set_int(range, "End", (end - start) * 90000);
+ ghb_dict_set_int(range, "End", end * 90000);
}
else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 2)
{
ghb_check_dependency(ud, widget, NULL);
update_title_duration(ud);
- ghb_dict_set_int(range, "Start", start - 1);
- ghb_dict_set_int(range, "End", end - start + 1);
+ ghb_dict_set_int(range, "Start", start);
+ ghb_dict_set_int(range, "End", end);
}
}
update_title_duration(ud);
ghb_dict_set_int(range, "Start", start * 90000);
- ghb_dict_set_int(range, "End", (end - start) * 90000);
+ ghb_dict_set_int(range, "End", end * 90000);
}
else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 2)
{
ghb_check_dependency(ud, widget, NULL);
update_title_duration(ud);
- ghb_dict_set_int(range, "Start", start - 1);
- ghb_dict_set_int(range, "End", end - start + 1);
+ ghb_dict_set_int(range, "Start", start);
+ ghb_dict_set_int(range, "End", end);
}
}
"End", hb_value_int(job->pts_to_stop),
"SeekPoints", hb_value_int(job->seek_points));
}
- else if (job->pts_to_start != 0)
+ else if (job->pts_to_start != 0 || job->pts_to_stop != 0)
{
range_dict = json_pack_ex(&error, 0, "{s:o, s:o, s:o}",
"Type", hb_value_string("time"),
"Start", hb_value_int(job->pts_to_start),
"End", hb_value_int(job->pts_to_stop));
+ range_dict = hb_dict_init();
+ hb_dict_set(source_dict, "Type", hb_value_string("time"));
+ if (job->pts_to_start > 0)
+ {
+ hb_dict_set(source_dict, "Start", hb_value_int(job->pts_to_start));
+ }
+ if (job->pts_to_stop > 0)
+ {
+ hb_dict_set(source_dict, "End",
+ hb_value_int(job->pts_to_start + job->pts_to_stop));
+ }
}
- else if (job->frame_to_start != 0)
+ else if (job->frame_to_start != 0 || job->frame_to_stop != 0)
{
- range_dict = json_pack_ex(&error, 0, "{s:o, s:o, s:o}",
- "Type", hb_value_string("frame"),
- "Start", hb_value_int(job->frame_to_start),
- "End", hb_value_int(job->frame_to_stop));
+ range_dict = hb_dict_init();
+ hb_dict_set(source_dict, "Type", hb_value_string("frame"));
+ if (job->frame_to_start > 0)
+ {
+ hb_dict_set(source_dict, "Start",
+ hb_value_int(job->frame_to_start + 1));
+ }
+ if (job->frame_to_stop > 0)
+ {
+ hb_dict_set(source_dict, "End",
+ hb_value_int(job->frame_to_start + job->frame_to_stop));
+ }
}
else
{
if (range_start >= 0)
job->pts_to_start = range_start;
if (range_end >= 0)
- job->pts_to_stop = range_end;
+ job->pts_to_stop = range_end - job->pts_to_start;
}
else if (!strcasecmp(range_type, "frame"))
{
- if (range_start >= 0)
- job->frame_to_start = range_start;
- if (range_end >= 0)
- job->frame_to_stop = range_end;
+ if (range_start > 0)
+ job->frame_to_start = range_start - 1;
+ if (range_end > 0)
+ job->frame_to_stop = range_end - job->frame_to_start;
}
}
{
range_type = "time";
range_start = start_at_pts;
- range_end = stop_at_pts;
+ if (stop_at_pts > 0)
+ range_end = start_at_pts + stop_at_pts;
}
else if (start_at_frame || stop_at_frame)
{
range_type = "frame";
range_start = start_at_frame;
- range_end = stop_at_frame;
+ if (stop_at_frame > 0)
+ {
+ if (start_at_frame > 0)
+ range_end = start_at_frame + stop_at_frame - 1;
+ else
+ range_end = stop_at_frame;
+ }
}
if (range_start || range_end)
{