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

Persistent & Cache streaming options alltogether #591

Merged
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5e378ff
Persistent & Cache streaming option alltogether
philippe44 Apr 18, 2021
57206b3
make persistent logic a bit more readable
philippe44 Apr 18, 2021
4802230
remove some un-necessary code
philippe44 Apr 18, 2021
7492ba0
HTTPS & clean-up
philippe44 Apr 18, 2021
9fd9e91
comment + cleanup note for ogg in HTTP
philippe44 Apr 18, 2021
f66d5b7
remove local trace
philippe44 Apr 18, 2021
17023b2
try to find better method names
philippe44 Apr 19, 2021
143bfd4
merge Persistent & Buffered in HTTP
philippe44 Apr 19, 2021
d87505e
handle HTTPS' multiple inheritance in Buffered mode
philippe44 Apr 19, 2021
8f3395e
handle redirects & header parsing + AAC AOT types
philippe44 Apr 21, 2021
1d6164b
backport typo
philippe44 Apr 21, 2021
e1f6897
no need to erase initialAudioBlock on ONCE
philippe44 Apr 21, 2021
69b4a25
let plugins override useEnhancedHTTP option
philippe44 Apr 21, 2021
a22e103
better LMS standards alignment
philippe44 Apr 22, 2021
bfa6cd8
spaces & tabs...
philippe44 Apr 22, 2021
3ab6d6d
more spaces & tabs
philippe44 Apr 22, 2021
6d61f50
contentRange should be parse in parseHeaders
philippe44 Apr 22, 2021
c8cdd5f
adding --tmpdir option
philippe44 Apr 23, 2021
7f97827
make sure 'tmpdir' is always defined, even when missing from cmdfile
philippe44 Apr 23, 2021
3614a1d
safety net in case user sets a dangerous tmpdir
philippe44 Apr 23, 2021
509876f
tmpdir is not a pref, really
philippe44 Apr 23, 2021
82bca9d
$tmpdir does not need to be defined now
philippe44 Apr 23, 2021
7b65208
document --tmpdir
philippe44 Apr 24, 2021
2350beb
fix some funny syntax
philippe44 Apr 24, 2021
794c75f
tweak info-bubble
philippe44 Apr 24, 2021
1346fd1
use CONSTANT, allow persistent on no content-length (single retry) an…
philippe44 Apr 24, 2021
236c530
tidy up naming & move setting to network
philippe44 Apr 24, 2021
05ef9ff
add a comment wrt EWOULDBLOCK vs EINTR
philippe44 Apr 25, 2021
decc2ea
typo
philippe44 Apr 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions HTML/EN/settings/server/performance.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@
</select>
[% END %]

[% WRAPPER setting title="SETUP_BUFFEREDHTTP" desc="SETUP_BUFFEREDHTTP_DESC" %]
<select class="stdedit" name="pref_useBufferedHTTP" id="useBufferedHTTP">
[% WRAPPER setting title="SETUP_ENHANCEDHTTP" desc="SETUP_ENHANCEDHTTP_DESC" %]
<select class="stdedit" name="pref_useEnhancedHTTP" id="useEnhancedHTTP">

<option [% IF NOT prefs.pref_useBufferedHTTP %]selected [% END %]value="0">[% 'SETUP_DISABLE_BUFFEREDHTTP' | getstring %]</option>
<option [% IF prefs.pref_useBufferedHTTP %]selected [% END %]value="1">[% 'SETUP_ENABLE_BUFFEREDHTTP' | getstring %]</option>
<option [% IF NOT prefs.pref_useEnhancedHTTP %]selected [% END %]value="0">[% 'SETUP_DISABLE_ENHANCEDHTTP' | getstring %]</option>
<option [% IF prefs.pref_useEnhancedHTTP == 1 %]selected [% END %]value="1">[% 'SETUP_ENABLE_PERSISTENTHTTP' | getstring %]</option>
<option [% IF prefs.pref_useEnhancedHTTP == 2 %]selected [% END %]value="2">[% 'SETUP_ENABLE_BUFFEREDHTTP' | getstring %]</option>
philippe44 marked this conversation as resolved.
Show resolved Hide resolved

</select>
[% END %]
Expand Down
19 changes: 15 additions & 4 deletions Slim/Formats/Movie.pm
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,10 @@ sub setADTSProcess {
$offset += 3 if $data == 0x80 || $data == 0x81 || $data == 0xfe;
$offset++;
$data = unpack("N", substr($$bufref, $pos + $offset, 4));
$codec->{freq_index} = ($data >> 23) & 0x0f;
$codec->{freq_index} = ($data >> 23) & 0x0f;
$codec->{channel_config} = ($data >> 19) & 0x0f;
$codec->{object_type} = $data >> 27;
# Fix because Touch and Radio cannot handle ADTS header of AAC Main.
$codec->{object_type} = 2 if $codec->{object_type} == 5;
$codec->{channel_config} = ($data >> 19) & 0x0f;
$codec->{object_type} = ($data >> 10) & 0x1f if $codec->{object_type} == 5 || $codec->{object_type} == 29;
philippe44 marked this conversation as resolved.
Show resolved Hide resolved
$pos += $len - 8;
} elsif ($type eq 'stsz') {
my $offset = 4;
Expand Down Expand Up @@ -405,6 +404,18 @@ sub extractADTS {
# M 13 frame length, this value must include 7 bytes of header
# O 11 Buffer fullness
# P 2 Number of AAC frames (RDBs) in ADTS frame minus 1, for maximum compatibility always use 1 AAC frame per ADTS frame
#
# ISO 14496 Part 3 Table 1.13
#
# A: Profile (2=LC, 5=SBR, 29=PS), R: Core SampleRate, M: Main SampleRate,
# C: Channels, X: Extensions, S=???, T=???, E=extension bit
#
# AOT=2 AOT=5|29 AOT=2 (extended)
# AAAA ARRR AAAA ARRR AAAA ARRR
# RCCC CXXX RCCC CMMM RCCC CXXX
# MPPP PP SSSS SSSS
# SSST TTTT
# ERRR R


1;
8 changes: 8 additions & 0 deletions Slim/Formats/RemoteStream.pm
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ sub request {
});
}

$self->response($args, $request, @headers) if $self->can('response');

main::INFOLOG && $log->info("Opened stream!");

return $self;
Expand Down Expand Up @@ -302,6 +304,12 @@ sub contentLength {
return ${*$self}{'contentLength'};
}

sub contentRange {
my $self = shift;

return ${*$self}{'contentRange'};
}

sub contentType {
my $self = shift;

Expand Down
15 changes: 3 additions & 12 deletions Slim/Player/ProtocolHandlers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ my %protocolHandlers = (
tmp => qw(Slim::Player::Protocols::Volatile),
mms => qw(Slim::Player::Protocols::MMS),
spdr => qw(Slim::Player::Protocols::SqueezePlayDirect),
http => qw(Slim::Player::Protocols::HTTP),
https => qw(Slim::Player::Protocols::HTTPS),
icy => qw(Slim::Player::Protocols::HTTP),
playlist => 0,
db => 1,
);

setHTTPHandler($prefs->get('useBufferedHTTP'));

$prefs->setChange(sub { setHTTPHandler($_[1]) }, 'useBufferedHTTP');
philippe44 marked this conversation as resolved.
Show resolved Hide resolved

tie my %URLHandlers, 'Tie::RegexpHash';

my %localHandlers = (
Expand All @@ -46,14 +45,6 @@ my %loadedHandlers = ();

my %iconHandlers = ();

sub setHTTPHandler {
my ($useBufferedHTTP) = @_;

$protocolHandlers{http} = $useBufferedHTTP ? qw(Slim::Player::Protocols::Buffered) : qw(Slim::Player::Protocols::HTTP),
$protocolHandlers{https} = $useBufferedHTTP ? qw(Slim::Player::Protocols::Buffered) : (Slim::Networking::Async::HTTP->hasSSL() ? qw(Slim::Player::Protocols::HTTPS) : qw(Slim::Player::Protocols::HTTP)),
$protocolHandlers{icy} = $useBufferedHTTP ? qw(Slim::Player::Protocols::Buffered) : qw(Slim::Player::Protocols::HTTP),
}

sub isValidHandler {
my ($class, $protocol) = @_;

Expand Down
99 changes: 0 additions & 99 deletions Slim/Player/Protocols/Buffered.pm

This file was deleted.