-
Notifications
You must be signed in to change notification settings - Fork 0
Implement segment precaching for HLS playlist streaming #57
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
Conversation
Co-authored-by: paul-1 <6473457+paul-1@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
paul-1
left a comment
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.
@copilot see comments
also, when logging number of segments to be cached, please include the total size of the cache for that channel
Plugins/SiriusXM/Bin/sxm.pl
Outdated
|
|
||
| my @segments = (); | ||
| for my $line (split /\n/, $content) { | ||
| if ($line =~ /\.aac$/) { |
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.
This is not finding any lines. there must be whitespace or other control character after the .aac
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.
Fixed in commit 59b9808. Changed regex from /\.aac$/ to /\.aac/ and added explicit removal of carriage returns with $line =~ s/\r//g; to handle whitespace and control characters after the .aac extension.
Plugins/SiriusXM/Bin/sxm.pl
Outdated
| } | ||
|
|
||
| # Extract and store segment list from the playlist | ||
| $self->extract_segments_from_playlist($content, $channel_id); |
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.
Move this to before we remove the 3 segments from the first playlist.
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.
Fixed in commit 59b9808. Moved extract_segments_from_playlist() call to before the segment removal logic, so it extracts from the original full playlist before any modifications.
Plugins/SiriusXM/Bin/sxm.pl
Outdated
| $self->{playlists}->{$channel_id}->{'segments'} = \@segments; | ||
|
|
||
| main::log_debug("Extracted " . scalar(@segments) . " segments for channel $channel_id"); | ||
| main::log_trace("Segments: " . join(", ", @segments)); |
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.
Remove this log, it is way to noisy. there are 1844 segments in each playlist.
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.
Fixed in commit 59b9808. Removed the noisy trace log that was printing all 1844 segments. Only kept the debug log showing the segment count.
- Fix regex to handle whitespace/control characters after .aac - Move segment extraction before playlist modification - Remove noisy trace log of all segments - Optimize to only search from last requested segment to end - Add total cache size to logging output Co-authored-by: paul-1 <6473457+paul-1@users.noreply.github.com>
All comments addressed in commit 59b9808. Also added total cache size reporting - logs now show "X uncached segments, current cache size: Y.YY MB" when logging segment caching activity. |
paul-1
left a comment
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.
@copilot see comments
Plugins/SiriusXM/Bin/sxm.pl
Outdated
| main::log_info("Starting precache of " . scalar(@remaining_segments) . | ||
| " segments for channel $channel_id, current cache size: " . | ||
| sprintf("%.2f MB", $cache_size / 1024 / 1024)); |
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.
I would also like to know the number of segments in the cache, in addition to the total size.
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.
Fixed in commit a8fd745. Log now shows "current cache: X segments (Y.YY MB)" format, displaying both the segment count and total size.
Include number of cached segments in addition to total size in log messages Co-authored-by: paul-1 <6473457+paul-1@users.noreply.github.com>
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.