[bug] signed integer limitation on playlist length

Discuss client development (or even MPD development if you feel so inclined), ask questions about the client libs, MPD feature requests from client developers, etc...
Locked
Redsandro
Posts: 3
Joined: July 2nd, 2014, 12:53 am

[bug] signed integer limitation on playlist length

Post by Redsandro » July 2nd, 2014, 1:00 am

As discussed here I figured that the playlist length is limited to 16384 items.

Now either there's a good reason and you can all laugh at me for bringing this up, or this is the limitation of a 16 bit signed integer. Change this to an unsigned integer and the limit doubles to 32768 entries.

Code: Select all

$ mpc listall | mpc add
error: playlist is at the max size
$ mpc playlist | wc -l
16384

Qball
Forum team
Posts: 54
Joined: January 15th, 2013, 4:03 pm

Re: [bug] signed integer limitation on playlist length

Post by Qball » July 2nd, 2014, 12:32 pm

Did you actually check the CODE? or just assumed it was a signed/unsigned issue?

If you check the available options for mpd configuration file you will see this has nothing todo with signed integer limitation but it is a configuration option.

Redsandro
Posts: 3
Joined: July 2nd, 2014, 12:53 am

Re: [bug] signed integer limitation on playlist length

Post by Redsandro » July 2nd, 2014, 1:16 pm

I don't know C++. I ran into the limitation. I recognize the number and the problem I mention from working with bitstreams as a Node developer.
So I didn't "assume", I took an educated guess and I thought I'd improve this nice Deamon by kindly letting the MPD people know.

I didn't think it was a configurable amount, because out of 32768 possibilities it's the only one relevant to this signed/unsigned scenario. In my lousy opinion, it's just silly to use 16384 as a configured limit. If it's not a software limitation, any human readable value would be better (10000, 20000, 30000). if it was any other number, I would have googled first. :ugeek:

Anyway sorry for wasting your rime Qball.
Last edited by Redsandro on July 2nd, 2014, 2:51 pm, edited 1 time in total.

Qball
Forum team
Posts: 54
Joined: January 15th, 2013, 4:03 pm

Re: [bug] signed integer limitation on playlist length

Post by Qball » July 2nd, 2014, 1:31 pm

No problem. Making it a nice round number might be better.

max
Forum team
Posts: 940
Joined: January 15th, 2013, 3:43 pm

Re: [bug] signed integer limitation on playlist length

Post by max » July 4th, 2014, 7:58 am

Redsandro wrote:this is the limitation of a 16 bit signed integer. Change this to an unsigned integer and the limit doubles to 32768 entries.
Funny. A signed 16 bit integer's upper bound is 32767, not 16384. Unsigned would be 65535, not 32768.

Redsandro
Posts: 3
Joined: July 2nd, 2014, 12:53 am

Re: [bug] signed integer limitation on playlist length

Post by Redsandro » July 4th, 2014, 3:24 pm

You are right. Apparently, I'm a bit stupid and I missed one bit.
Thanks for correcting me and letting me know. I appreciate that.

However, what's also stupid is using "one of those" binary maximums for an artificial limit. Why do people do that?

Qball
Forum team
Posts: 54
Joined: January 15th, 2013, 4:03 pm

Re: [bug] signed integer limitation on playlist length

Post by Qball » July 4th, 2014, 4:30 pm

I have _no_ idea why you keep complaining about it and calling it stupid.
This limit has been there for at least 11 years and nobody found this 'arbitrary' number a problem before.
For developers this might have been a very logical number to pick.
Anyway I am closing this topic, feedback is appreciated, this last remark isn't.

max
Forum team
Posts: 940
Joined: January 15th, 2013, 3:43 pm

Re: [bug] signed integer limitation on playlist length

Post by max » July 6th, 2014, 5:33 am

Redsandro wrote:However, what's also stupid is using "one of those" binary maximums for an artificial limit. Why do people do that?
I feel offended that you call me stupid. Please go away.

Locked