PDA

View Full Version : svn 2080 - contentType change



Triode
2005-02-18, 16:50
Dan, Kdf,

The $sock->contentType() call in Source.pm introduced in 2080 causes Alien to crash the server and I'm reasonably certain it will
cause MMS.pm to do the same...

Are you assuming this is the way forward and so all protcol handlers should have this function? Could I suggest a check it exists
before calling it, just incase there is a legacy protocol handler which would otherwise cause a crash.

I can probably propose a patch for MMS.pm as it will be the same as Alien...

Adrian

Dan Sully
2005-02-18, 16:55
* Triode shaped the electrons to say...

>The $sock->contentType() call in Source.pm introduced in 2080 causes Alien
>to crash the server and I'm reasonably certain it will cause MMS.pm to do
>the same...

It's going to go away.

-D
--
It does not do to leave a live Dragon out of your calculations..

Triode
2005-02-19, 05:58
>>The $sock->contentType() call in Source.pm introduced in 2080 causes Alien to crash the server and I'm reasonably certain it will
>>cause MMS.pm to do the same...
>
> It's going to go away.

Thanks Dan ....though not for changing the calling parameters to a protocol handler constructor!

As I want one code base for 5.4 and 6.0, I assume the easiest way is to test for existance of a named arguement and if not assume
the old convention [just checking there is no clever way in perl to do this ....?]

Adrian

Dan Sully
2005-02-19, 10:22
* Triode shaped the electrons to say...

>>It's going to go away.
>
>Thanks Dan ....though not for changing the calling parameters to a
>protocol handler constructor!
>
>As I want one code base for 5.4 and 6.0, I assume the easiest way is to
>test for existance of a named arguement and if not assume the old
>convention [just checking there is no clever way in perl to do this ....?]

Here's a patch.

--- RTSP.pm.orig 2005-02-19 09:15:17.566484668 -0800
+++ RTSP.pm 2005-02-19 09:19:05.790266579 -0800
@@ -40,8 +40,21 @@

sub new {
my $class = shift;
- my $url = shift;
- my $client = shift;
+
+ # Check for new or old calling method.
+ my $args = shift;
+ my ($url, $client);
+
+ if (ref($args) eq 'HASH') {
+
+ $url = $args->{'url'};
+ $client = $args->{'client'};
+
+ } else {
+
+ $url = $args;
+ $client = shift;
+ }

# Check client - only stream to known slim clients
my $player = defined($client) ? $client->model() : '';

-D
--
<iNoah> you know, most free operating systems come preinstalled with their own high horse.

Triode
2005-02-19, 13:33
>
> Here's a patch.
>
Thanks Dan.