IPhone memory leak from AudioToolbox when using MPMoviePlayerViewController iOS 4.2

I use the following code (inside the view controller in the tab bar application) to play the video downloaded from the main package after the user selects a row in the table.

- (void)loadMoviePlayer:(NSString*)moviePath
{
    NSURL* fileURL    =   [[NSURL alloc] initFileURLWithPath:moviePath];

    MPMoviePlayerViewController* player = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
    [fileURL release];

    [self presentMoviePlayerViewControllerAnimated:player];
    [player release];
}

The application creates and runs without any obvious problems in the simulator (I have not tested it on the device yet), but when I run it through the tools, a memory leak occurs during video playback. Tools distinguish AudioToolbox as the “Responsible Library” and SimAggregateDevice::SimAggregateDevice(_CFString const*, _CFString const*, long&) and

APComponent::CreateDispatchTable(AudioComponentPluginInterface*, unsigned long)

like "Responsible Personnel (s)".

Any light you can shed on this will be greatly appreciated! Thank.

+5
2

, AVFoundation , Mac OS X. - Alex Nichol 17.08.2011 23:53

.

0

iPhone iPad, , .

moview. mov

-(void)initAndPlayMovie:(NSURL *)movieURL andViewController:(UIViewController*)vCtr
{
    self.mPlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
    // we have movie from file - Alizee :)
    [self.mPlayer.moviePlayer setMovieSourceType:MPMovieSourceTypeFile];

    // we don't need standard controlls as we have built our own
    [self.mPlayer.moviePlayer setControlStyle:MPMovieControlStyleNone];

    // aspect fit to screen  mode
    [self.mPlayer.moviePlayer setScalingMode:MPMovieScalingModeAspectFit];

    // full screen mode
    [self.mPlayer.moviePlayer setFullscreen:YES animated:YES];

    // to start movie player
    [vCtr presentMoviePlayerViewControllerAnimated:self.mPlayer];

    // now we will add our own view over video player
    self.vCtr.view.frame=CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height-20);

    [self.mPlayer.view addSubview:self.vCtr.view];
}

- (void)stopTapped:(id)sender{
    [self.mPlayer.moviePlayer stop];
}

-(void)moviePlayBackDidFinish:(NSNotification*)notification
{
    [self.mPlayer dismissMoviePlayerViewControllerAnimated];
    [self.vCtr.view removeFromSuperview];
}
0

All Articles