3

在为 iOS 使用 iFrameExtractor 时,我在此行收到“EXC_BAD_ACCESS(code=1,address=0x8) 错误:

- (AVPacket*)readPacket {

    if (_currentPacket.size > 0 || _inBuffer) return &_currentPacket;

    NSMutableData *packetData = [audioPacketQueue objectAtIndex:0];
    _packet = [packetData mutableBytes];

    // NSLog(@"got audio stream");
    **if (_packet->dts != AV_NOPTS_VALUE) {**
        _packet->dts += av_rescale_q(0, AV_TIME_BASE_Q, _audioStream->time_base);
    }
    if (_packet->pts != AV_NOPTS_VALUE) {
        _packet->pts += av_rescale_q(0, AV_TIME_BASE_Q, _audioStream->time_base);
    }
    // NSLog(@"ready with audio");


    [audioPacketQueueLock lock];
    audioPacketQueueSize -= _packet->size;
    [audioPacketQueue removeObjectAtIndex:0];
    [audioPacketQueueLock unlock];



    _currentPacket = *(_packet);

    return &_currentPacket;   
}
4

0 回答 0