PATCH: Crash when importing music
#1
In some circumstances (which are unknown for me, but it happens for me though), XBMC crashes when a music library is selected. An assertion fails. I removed the assertion and replaced it with an if-construction, but maybe someone can trace down the real problem, what I'm not capable of because I lack the knowledge of how the system works. Anyway, you may want to include this patch in the SVN or apply it only when you have the same problem.

Code:
Index: guilib/StdString.h
===================================================================
--- guilib/StdString.h  (revision 10954)
+++ guilib/StdString.h  (working copy)
@@ -872,21 +872,21 @@
                        SSCodeCvt::result res   = SSCodeCvt::ok;
                        const SSCodeCvt& conv   = SS_USE_FACET(loc, SSCodeCvt);
                        SSCodeCvt::state_type st= { 0 };
-                       res                                             = conv.in(st,
-                                                                              pSrcA, pSrcA + nSrc, pNextSrcA,
-                                                                              pDstW, pDstW + nDst, pNextDstW);
+                       res = conv.in(st,pSrcA, pSrcA + nSrc, pNextSrcA,pDstW, pDstW + nDst, pNextDstW);

-                       ASSERT(SSCodeCvt::ok == res);
-                       ASSERT(SSCodeCvt::error != res);
-                       ASSERT(pNextDstW >= pDstW);
-                       ASSERT(pNextSrcA >= pSrcA);
+                       if (SSCodeCvt::ok == res)
+                       {
+                               ASSERT(SSCodeCvt::error != res);
+                               ASSERT(pNextDstW >= pDstW);
+                               ASSERT(pNextSrcA >= pSrcA);

-                       // Null terminate the converted string
+                               // Null terminate the converted string

-                       if ( pNextDstW - pDstW > nDst )
-                               *(pDstW + nDst) = '\0';
-                       else
-                               *pNextDstW = '\0';
+                               if ( pNextDstW - pDstW > nDst )
+                                       *(pDstW + nDst) = '\0';
+                               else
+                                       *pNextDstW = '\0';
+                       }
                }
                return pDstW;
        }
Reply
#2
It could be the background musicloader thread - does it occur when you enter a directory with music that may have been scanned into the music library in the past?

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
jmarshall Wrote:It could be the background musicloader thread - does it occur when you enter a directory with music that may have been scanned into the music library in the past?

Cheers,
Jonathan

Negative, it occurs when you load the library. That is, when you open the root music folder you just added for the first time (and every time thereafter because it scans it again).
Reply

Logout Mark Read Team Forum Stats Members Help
PATCH: Crash when importing music0