-
Notifications
You must be signed in to change notification settings - Fork 2
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
concatenate segments #491
concatenate segments #491
Conversation
d84c111
to
3761489
Compare
3761489
to
97a50d7
Compare
func (s *TSegmentList) AddSegmentData(segIdx int, data []byte) { | ||
s.mu.Lock() | ||
s.SegmentDataTable[segIdx] = data | ||
s.mu.Unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could do this with a defer like your other examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall lgtm 👍
97a50d7
to
ad403c9
Compare
Updates:
Also, looks like lint caught some issues that I'll need to address as well. |
Codecov Report
@@ Coverage Diff @@
## main #491 +/- ##
===================================================
- Coverage 55.04615% 54.41578% -0.63037%
===================================================
Files 40 41 +1
Lines 3250 3295 +45
===================================================
+ Hits 1789 1793 +4
- Misses 1324 1362 +38
- Partials 137 140 +3
Continue to review full report at Codecov.
|
transcode/transcode.go
Outdated
if transcodeRequest.GenerateMP4 { | ||
for _, profile := range transcodeProfiles { | ||
renditionList.AddRenditionSegment(profile.Name, | ||
video.TSegmentList{ | ||
SegmentDataTable: make(map[int][]byte), | ||
}) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be nice to just late initialise these inside video/media.go
when calls are made to GetSegmentList
further down
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the rest of the usage of the table happens inside concurrent routines, I wanted to keep the logic simplified and easier to debug by pre-creating the empty nested maps (tables) so that we're just getting/inserting in the go-routines.
e0bfd82
to
5629834
Compare
… file The segments returned from the T are first stored in the order they are received, and then sorted according to the segment index, and then concatenated into a single .ts file. A nested map with an outer and inner table is used to temporarily store the segment data streams.
5629834
to
b165e0f
Compare
Updates:
|
The segments returned from the T are first stored in the order they are
received, and then sorted according to the segment index, and then
concatenated into a single .ts file. A nested map with an outer and
inner table is used to temporarily store the segment data streams.
TODOs (will use follow-up PR for these):