feat(seek): support independent seek offsets#521
Merged
Conversation
Contributor
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-521.eastasia.1.azurestaticapps.net |
Contributor
There was a problem hiding this comment.
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_secondsandseek_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,band 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
r2h-seek-offset=a,bso begin and end seek times can be shifted independently.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:clangpnpm run lint:ruffpnpm run docs:build