On Tue, 12 Apr 2011, Luca Barbato wrote:

> On 4/12/11 3:47 PM, Martin Storsjö wrote:
> > Stop the avio input at a point where amf_parse_object can
> > continue parsing the end of the object seamlessly, when all
> > data is available.
> > 
> > If unsupported data is encountered within the keyframes object,
> > try seeking to the start of the keyframes object - if the seek
> > back was successful, the caller can continue parsing the rest
> > of the AMF data.
> 
> Looks nicely, how to test it?

Mostly by hacking it in different ways to test how it behaves.

You can test these different scenarios:
- Run normally with a file with an index, notice that the index is present 
  and works (seek in the file with ffplay)
- Make parse_keyframes_index return -1, notice that ffplay shows much less
  metadata than normally
- Make it forcibly do the seek at the end of the function (even if 
  aborting the parsing at an inconvenient place), notice that it still 
  shows as much metadata as it did initially, since it succeeded to seek 
  back
- If seeking back to the start of the block did fail, the function will 
  return < 0 and the rest of the packet won't be parsed => acceptable
  fallback for those corner cases IMO.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to