+
+ if([[queueToApply objectForKey:@"fEncodeStartStop"] intValue] == 0)
+ {
+ /* Chapter selection */
+ [self writeToActivityLog: "Start / Stop set to chapters"];
+ job->chapter_start = [[queueToApply objectForKey:@"JobChapterStart"] intValue];
+ job->chapter_end = [[queueToApply objectForKey:@"JobChapterEnd"] intValue];
+ }
+ else if ([[queueToApply objectForKey:@"fEncodeStartStop"] intValue] == 1)
+ {
+ /* we are pts based start / stop */
+ [self writeToActivityLog: "Start / Stop set to seconds ..."];
+
+ /* Point A to Point B. Since we cannot get frame accurate start times, attempt to glean a semi-accurate start time based on a percentage of the
+ * scanned title time as per live preview, while in some cases inaccurate its the best I can do with what I have barring a pre-scan index afaik.
+ */
+ /* Attempt to bastardize the live preview code to get a roughly 1 second accurate point a to point b encode ... */
+ /* get the start seconds from the start seconds field */
+ int start_seconds = [[queueToApply objectForKey:@"StartSeconds"] intValue];
+ //job->start_at_preview = start_seconds;
+ /* The number of seek points equals the number of seconds announced in the title as that is our current granularity */
+ //job->seek_points = [[queueToApply objectForKey:@"SourceTotalSeconds"] intValue];
+ job->pts_to_start = start_seconds * 90000LL;
+ /* Stop seconds is actually the duration of encode, so subtract the end seconds from the start seconds */
+ int stop_seconds = [[queueToApply objectForKey:@"StopSeconds"] intValue];
+ job->pts_to_stop = stop_seconds * 90000LL;
+
+ /* A bunch of verbose activity log messages to check on what should be expected */
+ [self writeToActivityLog: "point a to b should start at: %d seconds", start_seconds];
+ [self writeToActivityLog: "point a to b should start at (hh:mm:ss): %d:%d:%d", start_seconds / 3600, ( start_seconds / 60 ) % 60,start_seconds % 60];
+ [self writeToActivityLog: "point a to b duration: %d seconds", stop_seconds];
+ [self writeToActivityLog: "point a to b duration (hh:mm:ss): %d:%d:%d", stop_seconds / 3600, ( stop_seconds / 60 ) % 60,stop_seconds % 60];
+ [self writeToActivityLog: "point a to b should end at: %d seconds", start_seconds + stop_seconds];
+ [self writeToActivityLog: "point a to b should end at (hh:mm:ss): %d:%d:%d", (start_seconds + stop_seconds) / 3600, ( (start_seconds + stop_seconds) / 60 ) % 60,(start_seconds + stop_seconds) % 60];
+ }
+ else if ([[queueToApply objectForKey:@"fEncodeStartStop"] intValue] == 2)
+ {
+ /* we are frame based start / stop */
+ [self writeToActivityLog: "Start / Stop set to frames ..."];
+
+ /* Point A to Point B. Since we cannot get frame accurate start times, attempt to glean a semi-accurate start time based on a percentage of the
+ * scanned title time as per live preview, while in some cases inaccurate its the best I can do with what I have barring a pre-scan index afaik.
+ */
+ /* Attempt to bastardize the live preview code to get a roughly 1 second accurate point a to point b encode ... */
+ /* get the start seconds from the start seconds field */
+ int start_frame = [[queueToApply objectForKey:@"StartFrame"] intValue];
+ //job->start_at_preview = start_seconds;
+ /* The number of seek points equals the number of seconds announced in the title as that is our current granularity */
+ //job->seek_points = [[queueToApply objectForKey:@"SourceTotalSeconds"] intValue];
+ job->frame_to_start = start_frame;
+ /* Stop seconds is actually the duration of encode, so subtract the end seconds from the start seconds */
+ int stop_frame = [[queueToApply objectForKey:@"StopFrame"] intValue];
+ job->frame_to_stop = stop_frame;
+
+ /* A bunch of verbose activity log messages to check on what should be expected */
+ [self writeToActivityLog: "point a to b should start at frame %d", start_frame];
+ [self writeToActivityLog: "point a to b duration: %d frames", stop_frame];
+ [self writeToActivityLog: "point a to b should end at frame %d", start_frame + stop_frame];
+ }
+