Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8869363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:28:05+00:00 2026-06-14T17:28:05+00:00

At random times, my app crashes with this crash log. A magic solution would

  • 0

At random times, my app crashes with this crash log.

A magic solution would be ideal, but some help on where to start debugging this would also be helpful. The app is quite difficult to debug as it is a GPS based app, so if I know what to look for, I can build some kind of stress test.

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread:  0

Last Exception Backtrace:
0   CoreFoundation      0x3789c88f __exceptionPreprocess + 163
1   libobjc.A.dylib     0x31911259 objc_exception_throw + 33
2   AVFoundation        0x309301d9 -[AVPlayer _attachItem:andPerformOperation:withObject:] + 249
3   AVFoundation        0x309300db -[AVPlayer _insertItem:afterItem:] + 27
4   AVFoundation        0x30943b9d -[AVQueuePlayer insertItem:afterItem:] + 137
5   MediaPlayer         0x364a68b7 __block_global_2 + 199
6   libdispatch.dylib   0x34a4bc59 _dispatch_call_block_and_release + 13
7   libdispatch.dylib   0x34a4dee7 _dispatch_main_queue_callback_4CF$VARIANT$mp + 195
8   CoreFoundation      0x3786f2ad __CFRunLoopRun + 1269
9   CoreFoundation      0x377f24a5 CFRunLoopRunSpecific + 301
10  CoreFoundation      0x377f236d CFRunLoopRunInMode + 105
11  GraphicsServices    0x379eb439 GSEventRunModal + 137
12  UIKit               0x309fecd5 UIApplicationMain + 1081
13  App                 0x000b5b6f main (main.m:14)

I am playing a variety of movies (mov (H.264, 1024 x 576, AAC, 44100 Hz, Stereo (L R)) and sounds (MP3 and WAV), sometimes mixed.

Movies are played using the MPMoviePlayer, sounds use the AVAudioPlayer.

Happens on both ios 5 and 6. (iPad)

— edit: adding code —-

Video is prepared here:

- (void) prepareLayer:(NSDictionary*) aUserInfo{
    mMoviePlayerController.contentURL = [aUserInfo objectForKey:@"contenturl"];                     // set content
    [mMoviePlayerController prepareToPlay];
    mMoviePlayerController.shouldAutoplay = NO;                                                     // prevent autoplay
    mMovieShouldLoop = NO;
    [mWrapper setOpacity: 0];                                                                       // hide video view (we don't want to see the previous video file)                                                                           
}

mWrapper is used to encapsulate the video in a cocos2d node

- (void) showLayer {
    [mWrapper setVisible: YES];
    [mMoviePlayerController pause];
    mRetryCounter = 0;
    mMovieStarted = NO;
    self.visible = YES;
}

- (void) updateLayer {
    if (!self.visible)      {   return; }                                                                                       // not visible, so not updating (prevents accidental playing of video)

    if (mWarningHidden && !mMovieStarted)                                                                                       // if warning is hidden and the movieStarted flag is false
    {
        if (mMoviePlayerController.playbackState == MPMoviePlaybackStatePlaying) {                                              // if movie did start successfully.
            mMovieStarted = YES;                                                                                                // set flag
            [mWrapper setOpacity: 255];                                                                                         // show video view
        }
        else {                                                                                                                  // if movie is not playing yet          
            if (mRetryCounter == 0) {                                                                                           // if this is the first try
                [[[CCDirector sharedDirector] openGLView] addGestureRecognizer:mSwipe];                                         // enable swipe gesture
            }
            [mMoviePlayerController play];                                                                                      // start playing
            if (mMovieShouldLoop) {                                                                                             // and set loop or not
                if (mMoviePlayerController.repeatMode != MPMovieRepeatModeOne) {
                    mMoviePlayerController.repeatMode = MPMovieRepeatModeOne;
                }
            } else {
                if (mMoviePlayerController.repeatMode != MPMovieRepeatModeNone) {
                    mMoviePlayerController.repeatMode = MPMovieRepeatModeNone;
                }
            }


            if (mMoviePlayerController.playbackState != MPMoviePlaybackStatePlaying && mRetryCounter > 5) {                     // if movie not playing and retried for 5 times,
                mMoviePlayerController.contentURL = [[NSBundle mainBundle] URLForResource:@"novideo" withExtension:@"m4v"];     // switch to movie of static, indicating something went wrong
                [mMoviePlayerController play];                                                                                  // and play that.
            }

            if (mRetryCounter > 10) {
                mMovieStarted = YES;                                                                                            // if movie still doesn't run after switched to static and retrying that for 5 times, skip it.
                NSLog(@"A Movie was skipped after trying to play it for 10 times.");
            }           
            mRetryCounter++;                                                                                                    // count retries.           
        }
    }
}

— edit: removed the sound portion of the code snippets as they were not part of the problem, and changed the title to reflect the problem is in the MPMoviePlayerController, not in the AVPlayer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:28:06+00:00Added an answer on June 14, 2026 at 5:28 pm

    I worked around the problem by using the lower level AVPlayer instead of the MPMoviePlayer. This solved my problem completely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Several random customers get this exception every time I update my Android app. I've
Why would the following swap action fail at random times? int i,p,a[11] = {0,1,2,3,4,5,6,7,8,9,10
I am getting weird problem, the crash happens at random times, for example i
I'm developing an iOS5 App using ARC, and I started to get some random
I have an app, that had run hundreds of times fine, but very rarely
I'm running into a scenario where at random times I am getting Access Denied
I get a random issue with VS2008 (although not that random several times a
I would like to plot an image at a random position every time the
I have tried a long time to find help regarding a random date in
This is the first time I'm trying random numbers with C (I miss C#).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.