[mythtv] [RFC] AvFormatDecoder Improvements.

Kenneth Aafløy ke-aa at frisurf.no
Mon Nov 10 04:43:00 EST 2003


Hi!

In AvFormatDecoder and the Recorders in MythTV there is code to generate
a map of where keyframes in the recording is bytewise. Although the
concept of storing the keyframe locations for speeding up seeking is a
very good idea, I see some problems with files that have a variable
keyframe distance. When a clip with variable keyframe distance is
recorded and the keyframe locations are stored in the database, the code
'frames / keyframedist' will cause random overwrites when the keyframe
distance changes. I propose (and are willing to code as soon as the DVB
code is done with) a change, so that the key to positionMap will only be
based on the frame number. And that when doing seeking a search for the
closest keyframe to the frame requested will be performed.

Also, to generate a map for other files than mpeg2 files, could easily
be done with a if (mpa_pic.key_frame) in AVFD::GetFrame(). Some small
changes to libavformat is needed to set the startpos member of AVPacket
for other formats than Mpeg2.

To make the mythtv executable more like a normal player, I also propose
the addition of a command line flag to disable such features as the
positionMap, and making the seeking code able to work without it. This
way I could (almost) toss out my mplayer, and use mythtv as the player
for mythvideo also.


Kenneth



More information about the mythtv-dev mailing list