[FFmpeg-devel] [PATCH] First shot at AVCHD seeking via new seeking API

Ivan Schreter schreter
Sun Aug 9 16:50:33 CEST 2009


Hi Baptiste,

Ivan Schreter wrote:
> [...]
> Ok, so I'll implement your proposal regarding active flag and the 
> optimization for ts == max_ts. Per-stream term position is in my 
> opinion still necessary. Will it be OK to commit then?
Attached is the newest version of the patch.

I've addressed these points:

    * Removed "active" flag and replaced it with st->discard checking.
    * Also removed "found_hi" and "found_lo" flags, as the position can
      be used for that.
    * Added optimization for ts < ts_max by initializing terminating
      condition to ts_max for first iteration. Also, instead of
      positions, timestamps are used per-stream as terminating condition
      (makes the code for TS and byte seeking exactly the same).
    * Removed "fpos" approximation of frame position and instead keeping
      last-known position for multi-frame packets.
    * Per your request, I added saving/restoring of parser state to
      seek.c and calls to it in mpegts.c, so seeking to invalid position
      won't invalidate current stream state (or in other words, it will
      restore the state just before seeking, so next frame will be read
      as if no seek was attempted). This can be used generically, so I
      exposed it in seek.h.

I hope it's now OK to commit.

I also have code handling MPEG-PS ready (using the same method and same 
routines in seek.c and basically the same implementation of read_seek2 
as in mpegts.c), but there is the issue of partial frame read, which 
needs to be addressed first (another thread on ML).

Regards,

Ivan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: seek_cooked_lavf.patch
Type: text/x-patch
Size: 23456 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090809/d27b2e8b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: seek_cooked_mpegts.patch
Type: text/x-patch
Size: 4273 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090809/d27b2e8b/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: seek_cooked_seekregress.patch
Type: text/x-patch
Size: 4428 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090809/d27b2e8b/attachment-0002.bin>



More information about the ffmpeg-devel mailing list