Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transcript: support custom fix and overlay queue #211

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

limjoe
Copy link
Contributor

@limjoe limjoe commented Aug 17, 2024

No description provided.

platform/transcript.go Fixed Show fixed Hide fixed
platform/transcript.go Fixed Show fixed Hide fixed
// The total segments in overlay HLS.
const maxOverlaySegments = 9
// The default total segments in overlay HLS.
const defaultMaxOverlaySegments = 9
Copy link
Member

Choose a reason for hiding this comment

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

Should not repeat your code:

const defaultMaxOverlaySegments = 9
setEnvDefault("SRS_TRANSCRIPT_OVERLAY_QUEUE_LIMIT", "9")

const defaultMaxOverlaySegments = 9

// Get the total segments in overlay HLS.
func GetMaxOverlaySegments() (int, error) {
Copy link
Member

Choose a reason for hiding this comment

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

The function GetMaxOverlaySegments should be designed to ignore any error:

func GetMaxOverlaySegments() (int, error)

Use it in the transcript while ignoring any error:

maxOverlaySegments, _ := GetMaxOverlaySegments()

In the doMain, after setEnvDefault, check for the error:

setEnvDefault("SRS_TRANSCRIPT_OVERLAY_QUEUE_LIMIT", "9")
if _, err := GetMaxOverlaySegments(); err != nil {
    return errors.Wrapf(......)

If the environment is not set as expected, it should fail in main, not in the transcript.

platform/transcript.go Fixed Show fixed Hide fixed
platform/transcript.go Fixed Show fixed Hide fixed
platform/transcript.go Fixed Show fixed Hide fixed
platform/transcript.go Fixed Show fixed Hide fixed
platform/transcript.go Fixed Show fixed Hide fixed
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.

2 participants