Show
Ignore:
Timestamp:
12/02/09 19:58:45 (8 years ago)
Author:
robert
Message:

From Julen Garcia,"I've been lately working also with the ffmpeg plugin and I implemented pause(), seek() and getReferenceTime(). I think that I have solved the internal clock issues (maybe not in the most elegant way :?"

Files:
1 modified

Legend:

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

    r10809 r10851  
    214214} 
    215215 
    216 void FFmpegDecoder::resume()  
    217 { 
    218     m_pending_packet.clear(); 
    219  
    220     flushAudioQueue(); 
    221     flushVideoQueue(); 
    222     m_state = NORMAL; 
    223 } 
    224  
    225216void FFmpegDecoder::findAudioStream() 
    226217{ 
     
    295286            // If we reach the end of the stream, change the decoder state 
    296287            if (loop()) 
     288            { 
     289                m_clocks.reset(m_start); 
    297290                rewindButDontFlushQueues(); 
     291            } 
    298292            else 
    299293                m_state = END_OF_STREAM; 
     
    394388    const int64_t seek_target = av_rescale_q(pos, AvTimeBaseQ, m_video_stream->time_base); 
    395389 
     390    m_clocks.setSeekTime(time); 
     391 
    396392    if (av_seek_frame(m_format_context.get(), m_video_index, seek_target, 0/*AVSEEK_FLAG_BYTE |*/ /*AVSEEK_FLAG_BACKWARD*/) < 0) 
    397393        throw std::runtime_error("av_seek_frame failed()");