Skip to content

Commit

Permalink
Adjust segment time getter with time offset
Browse files Browse the repository at this point in the history
  • Loading branch information
david-winder-kaltura committed May 2, 2024
1 parent 26f0687 commit 41a700c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vod/media_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ media_set_get_segment_time_millis(media_set_t* media_set)
}
}

return cur_track->original_clip_time +
return cur_track->original_clip_time - media_set->time_offset +
rescale_time(cur_track->first_frame_time_offset, cur_track->media_info.timescale, 1000);
}
1 change: 1 addition & 0 deletions vod/media_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ typedef struct {
bool_t use_discontinuity;
bool_t presentation_end;
bool_t cache_mapping;
int64_t time_offset;

uint32_t clip_count; // number of clips relevant to serve the current request
uint32_t sequence_count;
Expand Down
1 change: 1 addition & 0 deletions vod/media_set_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,7 @@ media_set_parse_live_params(
if (params[MEDIA_SET_PARAM_TIME_OFFSET] != NULL)
{
request_context->time_offset = params[MEDIA_SET_PARAM_TIME_OFFSET]->v.num.num;
media_set->time_offset = params[MEDIA_SET_PARAM_TIME_OFFSET]->v.num.num * 1000;
}

// clip times
Expand Down

0 comments on commit 41a700c

Please sign in to comment.