From: Milan C. <mil...@us...> - 2004-10-28 06:50:18
|
Update of /cvsroot/ffdshow/ffdshow/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19384 Modified Files: TffDecoder.cpp Log Message: fix playback of mp4 files containing b-frames demuxed by nero splitter, never use IMediaPosition::get_Duration from decoding thread Index: TffDecoder.cpp =================================================================== RCS file: /cvsroot/ffdshow/ffdshow/src/TffDecoder.cpp,v retrieving revision 1.283 retrieving revision 1.284 diff -C2 -d -r1.283 -r1.284 *** TffDecoder.cpp 26 Oct 2004 17:57:25 -0000 1.283 --- TffDecoder.cpp 28 Oct 2004 06:50:02 -0000 1.284 *************** *** 591,597 **** //from this point the frame is correct and will be processed and displayed bool timechange=false; HRESULT frameTimeOk=pIn->GetTime(&frameTimeStart,&frameTimeStop); ! if (frameTimeOk==S_OK && !(mpeg12_codec(codecId) || codecId==CODEC_ID_THEORA_LIB) && again==0 && frameTimeStop-frameTimeStart!=0) ! { if (avgTimePerFrame==0) { --- 591,599 ---- //from this point the frame is correct and will be processed and displayed bool timechange=false; + LONGLONG mediaTime1=-1,mediaTime2=-1; + HRESULT mediaTimeOk=pIn->GetMediaTime(&mediaTime1,&mediaTime2); HRESULT frameTimeOk=pIn->GetTime(&frameTimeStart,&frameTimeStop); ! if ((frameTimeOk==S_OK && mediaTimeOk==S_OK) && !(mpeg12_codec(codecId) || codecId==CODEC_ID_THEORA_LIB) && again==0 && frameTimeStop-frameTimeStart!=0) ! { // ^--- for nero splitter with mp4 files containing b-frames if (avgTimePerFrame==0) { *************** *** 609,615 **** pOut->SetTime(&frameTimeStart,&frameTimeStop); } ! LONGLONG mediaTime1=-1,mediaTime2=-1; ! HRESULT tOk=pIn->GetMediaTime(&mediaTime1,&mediaTime2); ! if (tOk==S_OK) currentFrame=(unsigned long)mediaTime1; else if (frameTimeOk==S_OK && avgTimePerFrame) --- 611,616 ---- pOut->SetTime(&frameTimeStart,&frameTimeStop); } ! ! if (mediaTimeOk==S_OK) currentFrame=(unsigned long)mediaTime1; else if (frameTimeOk==S_OK && avgTimePerFrame) *************** *** 979,983 **** segmentFrameCnt=0; if ((tStop&i64(0xfffffffffffffff))==i64(0xfffffffffffffff)) ! moviesecs=TffdshowBase::getDuration(); //tStop is most probably wrong, risk getDuration even if it may cause lockup else moviesecs=int(tStop/10000000); --- 980,984 ---- segmentFrameCnt=0; if ((tStop&i64(0xfffffffffffffff))==i64(0xfffffffffffffff)) ! moviesecs=1; //tStop is most probably wrong, don't risk getDuration else moviesecs=int(tStop/10000000); |