This takes into account whether the granule defines the start or end times of packets, and sets the correct file offset of the associated page. Originally committed as revision 22462 to svn://svn.ffmpeg.org/ffmpeg/trunk