Skip to content

feat(seek): support independent seek offsets#521

Merged
stackia merged 2 commits into
mainfrom
codex/r2h-seek-offset-pair
Jun 12, 2026
Merged

feat(seek): support independent seek offsets#521
stackia merged 2 commits into
mainfrom
codex/r2h-seek-offset-pair

Conversation

@stackia

@stackia stackia commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Support r2h-seek-offset=a,b so begin and end seek times can be shifted independently.
  • Keep the existing single-value behavior by applying one offset to both begin and end times.
  • Carry the separate offsets through HTTP/RTSP query append, URL templates, Range Seek begin-time handling, and configured service query merge.
  • Update Chinese source docs and English translations with the new syntax.

Closes #516.

Validation

  • cmake --build build -j$(getconf _NPROCESSORS_ONLN)
  • ./scripts/run-e2e.sh test_url_template.py -k "seek_offset_pair or offset_pair"
  • ./scripts/run-e2e.sh test_rtsp_seek_mode.py -k "offset_pair or configured_seek_offset_pair"
  • ./scripts/run-e2e.sh test_url_template.py -k "seek_offset or offset"
  • ./scripts/run-e2e.sh test_rtsp_seek_mode.py -k "offset"
  • pnpm run lint:clang
  • pnpm run lint:ruff
  • pnpm run docs:build

@stackia stackia marked this pull request as ready for review June 12, 2026 04:32
@github-actions

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-521.eastasia.1.azurestaticapps.net

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends r2h-seek-offset to support an a,b form so begin/end seek times can be shifted independently, while preserving the legacy single-value behavior by applying one offset to both boundaries. The change is carried through seek parsing, HTTP/RTSP upstream query generation, URL templates, configured-service query merge behavior, and documentation.

Changes:

  • Split seek offset handling into seek_begin_offset_seconds and seek_end_offset_seconds, and propagate through seek parsing + upstream conversion logic.
  • Add/expand e2e coverage for offset pairs across URL templates, HTTP query append, RTSP query append, and Range Seek clock behavior.
  • Update CN/EN docs to document r2h-seek-offset=a,b and clarify Range Seek semantics (begin-only for window/clock).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/url_template.h Updates seek_parse_result_t to store begin/end offsets separately.
src/stream.c Passes per-boundary offsets into service_parse_seek_value() for HTTP/RTSP flows.
src/service.h Updates service_t and seek-related APIs to use begin/end offsets.
src/service.c Implements parsing of r2h-seek-offset as single or a,b, propagates offsets through parsing/conversion and config merge.
e2e/test_url_template.py Adds e2e tests validating offset-pair behavior for templates and query append (including Unix timestamps).
e2e/test_rtsp_seek_mode.py Adds e2e tests validating Range Seek uses begin offset for Range: clock= and config merge behavior for offset pairs.
docs/guide/url-formats.md Documents offset-pair usage in CN URL examples and guidance.
docs/guide/time-processing.md Documents a,b semantics and Range Seek begin-only behavior in CN.
docs/en/guide/url-formats.md Documents offset-pair usage in EN URL examples and guidance.
docs/en/guide/time-processing.md Documents a,b semantics and Range Seek begin-only behavior in EN.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/service.c
@stackia stackia merged commit 8c2456e into main Jun 12, 2026
7 of 8 checks passed
@stackia stackia deleted the codex/r2h-seek-offset-pair branch June 12, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

&r2h-seek-offset=-12这个参数整体偏移,我想起播往后移,结束往前移,这样回看时间准确一点。

2 participants