Show
Ignore:
Timestamp:
01/23/15 18:15:20 (2 days ago)
Author:
robert
Message:

From Javier Taibo,
"I have found a "bug" in the new audio decoding code (actually I think the bug is in ffmpeg, but anyway it should be wise to protect the OSG plug-in about it). I am attaching a security check in FFmpegDecoderAudio.cpp.

If anybody is curious about the problem, it happens sometimes when decoding an AAC audio stream. It eventually includes a PCE block inside the AAC audio frame and then ffmpeg audio decoding function signals a "new_frame" with 1024 samples, but a null pointer instead of the audio data. It can be easily detected because in these cases number of channels is 0. Maybe this is the intended behaviour for ffmpeg, but I find it quite weird.
"

" It seems that libav does not have a channels attribute in AVFrame structure. This new version should do."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/fbx/fbxRCamera.cpp

    r12337 r13466  
    1212#include "fbxReader.h" 
    1313 
    14 osgDB::ReaderWriter::ReadResult OsgFbxReader::readFbxCamera(KFbxNode* pNode) 
     14osgDB::ReaderWriter::ReadResult OsgFbxReader::readFbxCamera(FbxNode* pNode) 
    1515{ 
    16     const KFbxCamera* fbxCamera = KFbxCast<KFbxCamera>(pNode->GetNodeAttribute()); 
     16    const FbxCamera* fbxCamera = FbxCast<FbxCamera>(pNode->GetNodeAttribute()); 
    1717 
    1818    if (!fbxCamera) 
     
    3737        switch (fbxCamera->ApertureMode.Get()) 
    3838        { 
    39         case KFbxCamera::eHORIZONTAL: 
     39        case FbxCamera::eHorizontal: 
    4040            osgCameraView->setFieldOfViewMode(osg::CameraView::HORIZONTAL); 
    4141            break; 
    42         case KFbxCamera::eVERTICAL: 
     42        case FbxCamera::eVertical: 
    4343            osgCameraView->setFieldOfViewMode(osg::CameraView::VERTICAL); 
    4444            break; 
    45         case KFbxCamera::eHORIZONTAL_AND_VERTICAL: 
    46         case KFbxCamera::eFOCAL_LENGTH: 
     45        case FbxCamera::eHorizAndVert: 
     46        case FbxCamera::eFocalLength: 
    4747        default: 
    4848            OSG_WARN << "readFbxCamera: Unsupported Camera aperture mode." << std::endl;