Changeset 10538

Show
Ignore:
Timestamp:
08/20/09 16:59:00 (5 years ago)
Author:
robert
Message:

Added check against a minimual video size of 10x10 to prevent problems with swscale reporting errors and crashing on small video dimensionsline, and those below, will be ignored--

M ffmpeg/FFmpegImageStream.cpp

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp

    r9912 r10538  
    7373    ); 
    7474 
     75 
    7576    setPixelAspectRatio(m_decoder->video_decoder().pixelAspectRatio()); 
    76      
     77 
     78    osg::notify(osg::NOTICE)<<"ffmpeg::open("<<filename<<") size("<<s()<<", "<<t()<<") aspect ratio "<<m_decoder->video_decoder().pixelAspectRatio()<<std::endl; 
     79 
     80#if 1 
     81    // swscale is reported errors and then crashing when rescaling video of size less than 10 by 10. 
     82    if (s()<=10 || t()<=10) return false; 
     83#endif 
     84 
    7785    m_decoder->video_decoder().setUserData(this); 
    7886    m_decoder->video_decoder().setPublishCallback(publishNewFrame); 
    79      
     87 
    8088    if (m_decoder->audio_decoder().validContext()) 
    8189    { 
    8290        osg::notify(osg::NOTICE)<<"Attaching FFmpegAudioStream"<<std::endl; 
    83      
     91 
    8492        getAudioStreams().push_back(new FFmpegAudioStream(m_decoder.get())); 
    8593    }