[Jahshaka-cvs] openlibraries/src/openmedialib/plugins/avformat avformat_plugin.cpp, 1.73, 1.74
Status: Beta
Brought to you by:
jahshaka
From: Charles Y. <lil...@us...> - 2007-02-28 15:37:43
|
Update of /cvsroot/openlibraries/openlibraries/src/openmedialib/plugins/avformat In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7545 Modified Files: avformat_plugin.cpp Log Message: + sigh - vbr check with video OR audio only Index: avformat_plugin.cpp =================================================================== RCS file: /cvsroot/openlibraries/openlibraries/src/openmedialib/plugins/avformat/avformat_plugin.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- avformat_plugin.cpp 28 Feb 2007 14:15:25 -0000 1.73 +++ avformat_plugin.cpp 28 Feb 2007 15:37:38 -0000 1.74 @@ -1175,10 +1175,11 @@ seek( frames_ ); if ( seek_to_position( ) ) { + AVStream *stream = get_audio_stream( ) ? get_audio_stream( ) : get_video_stream( ); av_init_packet( &pkt_ ); - while ( av_read_frame( context_, &pkt_ ) >= 0 ) + while ( stream && av_read_frame( context_, &pkt_ ) >= 0 ) { - int result = int( av_q2d( get_audio_stream( )->time_base ) * pkt_.pts * avformat_input::fps( ) ); + int result = int( av_q2d( stream->time_base ) * pkt_.pts * avformat_input::fps( ) ); if ( result > 0 ) frames_ = result; } |