Old 22nd February 2007, 20:15   #1
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
API bug: extended_info always NULL with 5.33

Winamp 5.33 pro, clean install, WinXPpro.

In an own plugin that gets SendTo notification, the itemRecords all have a NULL pointer in the extended_info member. This was not the case with 5.32.

I could do this, e.g.:
char* bitrate = getRecordExtendedItem(ice,"BITRATE");
and got a result.

Now, with 5.33, this is always NULL!
It is not possible to get ANY of the extended item info fields.

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Old 22nd February 2007, 21:35   #2
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
Strange! The code is assigning a value
code:

char **extinf = (char **)calloc(sizeof(char *), (NUM_EXTRA_COLS + 2));
obj->Items[obj->Size].extended_info = extinf;



So I'm not sure what's going on

Any chance you provide a quick example plugin in C++ so I can debug? If not, I'll make one myself, but figure this stuff is probably fresh on your mind
Benski is offline   Reply With Quote
Old 22nd February 2007, 22:00   #3
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Well, not really a quick example, but you could use the ml_iPod code. It's in CVS at http://sourceforge.net/cvs/?group_id=106528. But I could also give you a tarball. I know that's 98% overkill, but this is where I could see this strange effect.

A breakpoint at line 8412 in view_ipod.cpp should do, after using the SendTo to the iPod. If you don't have an iPod, you can use any harddisk as a substitute for debugging (this is what I do all the time). Tell me if you need advice for this...

As a sidenote: I found this only by chance, while debugging a bug report from a ml_iPod user who had problems with the transcoding feature in ml_iPod. It started to transcode every file during transfer after he upgraded to 5.33, even the ones that should be simply copied to the iPod. Debugging showed that this is the case because we get no actual bitrate through the itemRecord, so the decision is to transcode...

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE

Last edited by abu; 22nd February 2007 at 22:18.
abu is offline   Reply With Quote
Old 23rd February 2007, 00:38   #4
will
Nullsoft Newbie (Moderator)
 
will's Avatar
 
Join Date: Mar 2001
Location: Sheffield, England
Posts: 5,569
Quote:
Originally posted by abu
line 8412
damn.

DO NOT PM ME WITH TECH SUPPORT QUESTIONS
will is offline   Reply With Quote
Old 23rd February 2007, 00:42   #5
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
Quote:
Originally posted by will
damn.
hahahaha


Seriously, though, it's fixed for 5.34
Benski is offline   Reply With Quote
Old 23rd February 2007, 06:29   #6
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Just curious, what was the problem?

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Old 23rd February 2007, 06:36   #7
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
itemRecordW -> itemRecord copy routine
Benski is offline   Reply With Quote
Old 23rd February 2007, 07:07   #8
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Quote:
Originally posted by will
damn.
LOL. But that's almost the end (at 8589)

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Old 23rd February 2007, 07:21   #9
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Benski, while you're at this: Would you mind looking at these two bug that I reported earlier, regarding the itemRecord stuff:

http://forums.winamp.com/showthread....23#post2084323

http://forums.winamp.com/showthread....93#post2084493

Thanks!

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Old 23rd February 2007, 13:32   #10
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
Quote:
Originally posted by abu
Benski, while you're at this: Would you mind looking at these two bug that I reported earlier, regarding the itemRecord stuff:

http://forums.winamp.com/showthread....23#post2084323

http://forums.winamp.com/showthread....93#post2084493

Thanks!
I believe these are fixed in 5.33. It was due to a bug in ml_lib.cpp (reported elsewhere in the Development forum). Or are you still seeing this bug in 5.33?

ps the "Magic number" in the post following your second link is something like "offset of the 8th-to-last frame, in bytes". It's used to ensure gapless playback after a seek. Gapless playback on the iPod should work as long as you don't try to seek in the track (however, only have a regular ipod to test with, not a nano).
Benski is offline   Reply With Quote
Old 23rd February 2007, 14:16   #11
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Quote:
Originally posted by Benski
I believe these are fixed in 5.33. ... Or are you still seeing this bug in 5.33?
Haven't tested with 5.33 yet. I'll do that soon and report.
Quote:
ps the "Magic number" in the post following your second link is something like "offset of the 8th-to-last frame, in bytes". It's used to ensure gapless playback after a seek. Gapless playback on the iPod should work as long as you don't try to seek in the track (however, only have a regular ipod to test with, not a nano).
That sound promising. Did Will implement that already, for pmp_ipod?
All my tests were with seeking, of course (for testing, you never listen to the whole song)

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Old 23rd February 2007, 14:19   #12
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
Quote:
Originally posted by abu
That sound promising. Did Will implement that already, for pmp_ipod?
All my tests were with seeking, of course (for testing, you never listen to the whole song)
When Will and I were implementing the gapless playback stuff, I had just cut up a song into a bunch of 10 second clips and then encoded those to MP3 and M4A. Made it easier to test

But, no, the seeking stuff isn't implemented yet
Benski is offline   Reply With Quote
Old 23rd February 2007, 14:44   #13
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Update: The albumartist crash (the second issue) seems to be ok with 5.33.
But the TUID2 bug is still present. Doing a ML_IPC_DB_UPDATEITEM with an itemRecord where the extended_info contains a TUID2 field always leads to Winamp crash.

And what's more: If I change the field name to TUID1 or anything else, no crash, but the field is silently discarded. That is, in a later query it does not show! So it is not possible to add custom fields to an itemRecord.

All tested with 5.33 now.
code:

char query[]="artist=queen";
mlQueryStruct mqs={query,0,};
SendMessage(plugin.hwndLibraryParent,WM_ML_IPC,(WPARAM)&mqs,ML_IPC_DB_RUNQUERY); //run the query
int lr=mqs.results.Size;
for(int i=0; i<lr; i++)
{
itemRecord *ice=&mqs.results.Items[i];
itemRecord newIce;
char *pp = getRecordExtendedItem(ice,"TUID2"); // peek
copyRecord(&newIce, ice);
setRecordExtendedItem(&newIce,"TUID2", "123"); // provoke the crash
SendMessage(plugin.hwndLibraryParent,WM_ML_IPC,(WPARAM)&newIce,ML_IPC_DB_UPDATEITEM); // CRASH!
...


WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Old 23rd February 2007, 15:03   #14
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Oh, and just to make sure: The original problem of this thread was not only with SendTo, also with Drag'n Drop. Maybe that's the same code, but maybe not. Just wanted to let you know.

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Old 23rd February 2007, 18:57   #15
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
abu -

Would you like the ability to store custom fields in the media library database? I think I can arrange that.
Benski is offline   Reply With Quote
Old 23rd February 2007, 19:11   #16
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
TUID2 bug is fixed (finally, heh). The update code was written assuming that all extended fields were numeric fields, and was never updated when new string fields were added. I bet putting in composer, publisher, etc would also cause a crash.
Benski is offline   Reply With Quote
Old 23rd February 2007, 19:11   #17
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Regarding custom fields: Actually, I don't have that need at the moment. I just thought I read that somewhere in the SDK or in the forum that it should already be possible... Maybe that was wrong, or my memory is getting worse

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Old 23rd February 2007, 19:21   #18
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Quote:
Originally posted by Benski
TUID2 bug is fixed (finally, heh). The update code was written assuming that all extended fields were numeric fields, and was never updated when new string fields were added. I bet putting in composer, publisher, etc would also cause a crash.
Cool. Couldn't test with the other fields, 'cause they are all present (though empty) by default.
And there is still no way to remove a field from the record, right?
The strange thing though is that the crash happened with records that HAD the TUID2 already, just by writing it back. So it looked like a very special handling of this one field.
Simply retrieving the itemRecord and writing it back unaltered (with ML_IPC_DB_UPDATEITEM) led to the crash. I haven't seen this behaviour with any other field.

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Old 28th February 2007, 21:30   #19
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Quote:
Originally posted by Benski
But, no, the seeking stuff isn't implemented yet
I did that now for ml_ipod, maybe you or Will can reuse the code... It's in SourceForge. With that, it works on the Nano, too.
And without that seeking information, the Nano definitly clicks even without seeking first. So for the Nano, that value is necessary for gapless. Strange that it works differently on the 'big' iPods...

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Winamp > Winamp Bug Reports

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump