[vlc-devel] rfc: ffmpeg demuxer seeking (ticket 981) - changeset 17604 (backport of 17597)

Petr Vacek p.vacek at sh.cvut.cz
Sun Jan 14 19:26:14 CET 2007


Greetings,
as I wrote in ticket 981 (https://trac.videolan.org/vlc/ticket/981) I've  
had  a problem seeking within raw DV files in 0.8.6 (and HEAD), while with  
0.8.5 it works. The changeset 17604 (backport of 17597)  
(https://trac.videolan.org/vlc/changeset/17604) was trying to imporve  
avformat demux SET_POSITION, but I beleive it made it broken. While at  
first sight I thought that reversion won't be a good solution, now I am  
consufed after reading code around some more and trying some easy hacks. I  
would like to know if someone could give me advice
on how was it suppposed to improve seeking. By the looks it introduced  
BYTE seeking, but even that seems not to work correctly at least with raw  
DV files for me (raw DV files don't have duration reported as they are of  
stream nature).

I'll show the part where at least something is not alright :
modules/codec/ffmpeg/demux.c
old revision -rev 15634:
case DEMUX_SET_POSITION:
             f = (double) va_arg( args, double );
	    i64 = stream_Tell( p_demux->s );
             if( i64 && p_sys->i_pcr > 0 )
             {
                 int64_t i_size = stream_Size( p_demux->s );

                 i64 = p_sys->i_pcr * i_size / i64 * f;
                 if( p_sys->ic->start_time != AV_NOPTS_VALUE )
                     i64 += p_sys->ic->start_time;

newer revisions -HEAD (18594):
case DEMUX_SET_POSITION:
             f = (double) va_arg( args, double );
	    i64 = stream_Tell( p_demux->s );
             if( p_sys->i_pcr > 0 )
             {
                 i64 = p_sys->ic->duration * f;
                 if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
                     i64 += p_sys->ic->start_time;

in the newer revisions i64=stream_Tell(...) is never used (side  
effects?optimization?I don't understand),
start_time is added to different data (I may be wrong here), this is not a  
complete  changeset listing.

I would be glad if someone could provide a sample file,which uses BYTE  
seeking  works ok with never revisions.
Thank you for any comment and advice in advance.

Petr Vacek
trac: Quentar
p.vacek < at > sh.cvut.cz

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list