Changeset 10161

Show
Ignore:
Timestamp:
05/08/09 09:46:46 (5 years ago)
Author:
robert
Message:

From Jean-Sebastien Guay, changed the timing control for when no audio layer is supplied.

Location:
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegClocks.hpp

    r9816 r10161  
    3030    void audioSetDelay(double delay); 
    3131    void audioDisable(); 
     32    bool audioDisabled() const { return m_audio_disabled; } 
    3233 
    3334    double videoSynchClock(const AVFrame * frame, double time_base, double pts); 
  • OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp

    r10088 r10161  
    191191                const double frame_delay = m_clocks.videoRefreshSchedule(synched_pts); 
    192192 
    193                 publishFrame(frame_delay); 
     193                publishFrame(frame_delay, m_clocks.audioDisabled()); 
    194194            } 
    195195        } 
     
    269269 
    270270 
    271 void FFmpegDecoderVideo::publishFrame(const double delay) 
     271void FFmpegDecoderVideo::publishFrame(const double delay, bool audio_disabled) 
    272272{ 
    273273    // If no publishing function, just ignore the frame 
     
    275275        return; 
    276276 
     277#if 1 
     278    // new code from Jean-Sebasiten Guay - needs testing as we're unclear on the best solution 
     279    // If the display delay is too small, we better skip the frame. 
     280    if (!audio_disabled && delay < -0.010) 
     281        return; 
     282#else 
     283    // original solution that hung on video stream over web. 
    277284    // If the display delay is too small, we better skip the frame. 
    278285    if (delay < -0.010) 
    279286        return; 
    280          
     287#endif 
     288 
    281289    AVPicture * const src = (AVPicture *) m_frame.get(); 
    282290    AVPicture * const dst = (AVPicture *) m_frame_rgba.get(); 
  • OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp

    r9960 r10161  
    8686    void decodeLoop(); 
    8787    void findAspectRatio(); 
    88     void publishFrame(double delay); 
     88    void publishFrame(double delay, bool audio_disabled); 
    8989    double synchronizeVideo(double pts); 
    9090    void yuva420pToRgba(AVPicture *dst, AVPicture *src, int width, int height);