[MPlayer-dev-eng] About mplayer dvd seek, I've checked DVDx source code
Bo Xie
xiebopublic at gmail.com
Sat Apr 16 17:42:06 CEST 2005
Hi,
I know mplayer can not seek DVD *accurately* for a long time. And I
know the reasons are: (1)DVD has no index; (2) DVD is always VBR,not
CBR. Then it is impossible to seek *accurately* until we scan the
total dvd and build a index.
But I find DVDx(http://www.labdv.com/dvdx/) can seek nearly
accurately. I want to know why and the following is what I find.
---------------------------------
The key function to cover DVD seek is:
void CMpeg_encodeDlg::OnReleasedcaptureSlider(NMHDR* pNMHDR, LRESULT* pResult)
And the key source code is:
if( found ) {
int diff_lba =
ifo_info.pgc[input_setting.pgc].cells[i].end_lba-ifo_info.pgc[input_setting.pgc].cells[i].start_lba;
double diff_time = (new_time-sum) /
ifo_info.pgc[input_setting.pgc].cells[i].playback_time;
decode_at_lba =
ifo_info.pgc[input_setting.pgc].cells[i].start_lba+(int)((double)diff_lba*diff_time)
;
input_setting.start_lba = decode_at_lba;
ok_decode = MPEG2Seek(decode_at_lba);
if(ok_decode) RenderCurrent();
}
I guess the idea is: Find the nearest cell,and the cell time
length(e.g. 5 seconds),cell size(e.g. 10MB),cell seeking time(e.g. 2
seconds). Then the cell seeking location is 2/5*10=4MB.
I mean DVDx firstly locate a cell by .ifo information and then assume
it is CBR in the cell to locate the seek location. But ffmpeg just
assume the total DVD is CBR and locate it.
---------------------------------
I don't know whether I am right or not and looking forward to your reply!
Best Regards,
Xie Bo
More information about the MPlayer-dev-eng
mailing list