Open
Conversation
- Add inline timing conversion functions (nsToMs, nsTo90kPts, pts90kToMs, msTo90kPts) to replace magic numbers like /11111, /90, *90, /1000000 - Add helper methods isWebVTT(), isWebVTTLive(), isTextSubtitle() to simplify complex condition checks throughout the code - Add resetWebVTTState() to centralize WebVTT state variable resets - Add getDecoderTimeNs() to consolidate decoder time queries from audio/video sinks - Clean up pushSubtitles() by removing commented debug code and simplifying logic - No functional changes, only code readability improvements
- Create new servicewebvtt.h/cpp with WebVTTParser class and WebVTTSubtitleEntry struct - Move WebVTT parsing logic from servicemp3.cpp to dedicated module - WebVTTParser handles X-TIMESTAMP-MAP for HLS/MPEG-TS synchronization - Add WebVTTState struct for runtime synchronization state (prepared for future use) - Remove ~180 lines of duplicated code from servicemp3.cpp - Update Makefile.inc to build new module
- Add SubtitleResult enum for handler return values - Extract handleWebVTTLiveSubtitle() for live stream wall-clock timing - Extract handleWebVTTSubtitle() for VOD decoder-based timing - Extract handleTextSubtitle() for SRT/SSA/ASS with fps conversion - Simplify pushSubtitles() to ~70 lines dispatcher from ~200 lines - Remove goto statements and simplify control flow - Each handler is self-contained and independently testable
…helpers - Extract handleStateChange(), handleAsyncDone(), handleTagMessage(), handleElementMessage() from 600-line gstBusCall() switch statement - Add GstMessageContainerType enum to replace magic numbers 1/2/3 - Add clearSubtitleState() helper to deduplicate enable/disableSubtitles - Simplify gstBusCall() to clean dispatcher pattern (~70 lines) - Remove dead code blocks (#if 0) and obsolete xtrend workaround comments
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.
No description provided.