[MPlayer-dev-eng] [PATCH] compute correct length for theora videos

Julian Kniephoff Julian.Kniephoff at gmx.de
Tue May 13 14:09:50 CEST 2008


Am Montag, 12. Mai 2008 20:18:18 schrieb Reimar Döffinger:
> Or saying it differently: I am fairly sure that final_granulepos is
> _supposed_ to be in the "fixed" form already.

OK, I looked into the code you mentioned again - around line 293 in 
demux_ogg.c - and made some tests with it. As it turns out, the code inside 
the condition (if (context != NULL && !(*data&0x80))) is actually never 
executed; at least not before the length of the video is calculated and shown 
in -identify-mode. This is because the first condition - context != NULL - is 
always false at that time, so context IS NULL. I can't really see why this 
condition is actually there as context is not used in the if block but maybe 
I'm missing something here - as stated often enough I still don't understand 
MPlayers "code complex" completely.
I had a short look into where this context gets assigned and found a line in 
vd_theora.c inside the init () function. I placed a "puts ()" there either 
and saw that it also gets executed much later than the length calculation.

NOW I don't get forward anymore as I don't know whether context being NULL is 
normal or if not what it is supposed to be and so on, so help is appreciated 
here ;)

Concerning the seeking code: I didn't have such a deep look but you're right, 
it uses final_granulepos for example around line 1377 (may differ a bit from 
the SVN version because I have some "printf/puts-lines" added) BUT what is 
confusing here is that according to the comment above that code block, it 
actually expects a granulepos; i.e. an "uncorrected" value because as far as 
I understand it the "corrected" value would be a frame count. But again this 
could be a misunderstanding on my side...

Regards,
Julian.



More information about the MPlayer-dev-eng mailing list