Skip to content

Conversation

@limjoe
Copy link
Contributor

@limjoe limjoe commented Aug 17, 2024

No description provided.

// 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants