Summary: | Amarok crashes when connecting to an MTP device | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Dima Ryazanov <dima> |
Component: | general | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | andy |
Priority: | NOR | ||
Version: | 1.4.4 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Avoid crashing Amarok if a playlist has an invalid track ID in it |
Description
Dima Ryazanov
2006-10-31 07:54:28 UTC
Can you try using the "mtp-playlists" utility from libmtp and post the results? Looks like there might be some invalid playlist entries in there. Oh, you're right. Earlier, I tried to create a playlist, and failed miserably. The output of mtp-playlists: Autodetected device "SanDisk Sansa e200" (VID=0781,PID=7420) is known. PTP: Opening session Connected to MTP device. LIBMTP_Get_Playlist: Could not get object references LIBMTP_Get_Playlist: Could not get object references LIBMTP_Get_Playlist: Could not get object references Playlist ID: 393217 Tracks: 3866643: INVALID TRACK REFERENCE! Playlist ID: 393219 Tracks: Playlist ID: 393220 Tracks: Playlist ID: 393221 Tracks: PTP: Closing session OK. Created attachment 18332 [details]
Avoid crashing Amarok if a playlist has an invalid track ID in it
OK. It looks like the player keeps a playlist with invalid track IDs in it. (I
think my test device keeps consistency and so this situation would never
occur).
A quick solution is to delete those playlists (either on the device or using
mtp-delfile).
Before you do that, I have a small patch which should prevent the crash. Are
you able to test it for me? If it's OK, I'll check it into SVN.
I didn't apply the patch yet (since I used "emerge", I can't compile Amarok incrementally - only recompile the whole thing, which takes a while). But, I put a breakpoint at that line and skipped everything if track == 0 - and, it worked. No more crash. (No songs, either, but that's probably a different problem... Or I screwed up with gdb.) I'll recompile everything tomorrow. SVN commit 600636 by kelk: Fix crash if an MTP media device returns a playlist with an invalid track ID. BUG: 136552 M +2 -0 ChangeLog M +2 -0 src/mediadevice/mtp/mtpmediadevice.cpp --- trunk/extragear/multimedia/amarok/ChangeLog #600635:600636 @@ -13,6 +13,8 @@ * Amarok now saves playlists with relative paths by default. BUGFIXES: + * Fix crash when an MTP media device returned a playlist with an + invalid track ID. (BR 136552) * The Install MP3 support script would be run regardless of what the user answered to the shown dialog. (BR 136294) * OSD wouldn't always show up-to-date ratings. Patch by Tuomas Nurmi --- trunk/extragear/multimedia/amarok/src/mediadevice/mtp/mtpmediadevice.cpp #600635:600636 @@ -1327,6 +1327,8 @@ for( i = 0; i < playlists->no_tracks; i++ ) { MtpTrack *track = m_idToTrack[ playlists->tracks[i] ]; + if( track == 0 ) // skip invalid playlist entries + continue; MtpMediaItem *item = new MtpMediaItem( playlist ); item->setText( 0, track->bundle()->artist() + " - " + track->bundle()->title() ); item->setType( MediaItem::PLAYLISTITEM ); |