Fundación para reproducir un bucle de video.

Necesito reproducir un video indefinidamente (reiniciar el video cuando termine) en mi aplicación OpenGL. Para ello estoy tratando de utilizar la fundación AV. Creé un AVAssetReader y un AVAssetReaderTrackOutput y utilizo el método copyNextSampleBuffer para obtener CMSampleBufferRef y crear una textura OpenGL para cada fotograma.

    NSString *path = [[NSBundle mainBundle] pathForResource:videoFileName ofType:type];
    _url = [NSURL fileURLWithPath:path];

    //Create the AVAsset 
    _asset = [AVURLAsset assetWithURL:_url];

    //Get the asset AVAssetTrack
    NSArray *arrayAssetTrack = [_asset tracksWithMediaType:AVMediaTypeVideo];
    _assetTrackVideo = [arrayAssetTrack objectAtIndex:0];

    //create the AVAssetReaderTrackOutput
    NSDictionary *dictCompressionProperty = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey:(id) kCVPixelBufferPixelFormatTypeKey];
    _trackOutput = [AVAssetReaderTrackOutput assetReaderTrackOutputWithTrack:_assetTrackVideo outputSettings:dictCompressionProperty];

    //Create the AVAssetReader
    NSError *error;
    _assetReader = [[AVAssetReader alloc] initWithAsset:_asset error:&error];
    if(error){
        NSLog(@"error in AssetReader %@", error);
    }
    [_assetReader addOutput:_trackOutput];
    //_assetReader.timeRange = CMTimeRangeMake(kCMTimeZero, _asset.duration);

    //Asset reading start reading
    [_assetReader startReading];

Y en el método de actualización de mi GLKViewController llamo a lo siguiente:

if (_assetReader.status == AVAssetReaderStatusReading){
    if (_trackOutput) {
        CMSampleBufferRef sampleBuffer = [_trackOutput copyNextSampleBuffer];
        [self createNewTextureVideoFromOutputSampleBuffer:sampleBuffer]; //create the new texture
    }
}else if (_assetReader.status == AVAssetReaderStatusCompleted) {
    NSLog(@"restart");
    [_assetReader startReading];
}

Todo funciona bien hasta que AVAssetReader está en estado de lectura, pero cuando terminó de leer e intenté reiniciar AVAssetReading con una nueva llamada [_assetReader startReading], la aplicación se bloquea sin resultado. ¿Qué estoy haciendo mal? ¿Es correcto reiniciar un AVAssetReading cuando finaliza su lectura?

Respuestas a la pregunta(2)

Su respuesta a la pregunta