* from there. Should be less than the results of {@link #testReadPackets()}.
*/
@Test
public void testSeekKeyFrame()
{
IContainer container = IContainer.make();
int retval = -1;
retval = container.open(mSampleFile, IContainer.Type.READ, null);
assertTrue("could not open file", retval >= 0);
// annoyingly we need to make sure that the timestamp is in the time
// base of the stream we're looking for which can be different for each stream.
//
// we happen to know that FLV is in milliseconds (or 1/1000 per second) so
// we multiply our desired number of seconds by 1,000
retval = container.seekKeyFrame(0, 20*1000, IURLProtocolHandler.SEEK_CUR);
assertTrue("could not seek to key frame", retval >=0);
long packetsRead = 0;
IPacket packet = IPacket.make();
while(container.readNextPacket(packet) >= 0)
{
if (packet.isComplete())
++packetsRead;
}
assertEquals("got unexpected number of packets in file", 6905, packetsRead);