On Thu, May 10, 2012 at 1:08 PM, Alex Cohn <[email protected]> wrote:
> This code implies that the actual compressed packets are of the size > that fits precisely into INBUF_SIZE. Otherwise, when you reach the end > of first buffer you got from fread(), you will have a non-complete > packet. The decoder cannot handle such case. You should put this > remaining chunk aside and append the data you read from the file so > that the compressed packets that go to decoder are always complete. > > The trick is, you don't know the actual size of the next packet, > therefore you cannot decide whether to read another piece of data from > the file, or not. This is why it is preferred to use avformat > functions to read the file. > > BR, > Alex Cohn > _______________________________________________ > Libav-user mailing list > [email protected] > http://ffmpeg.org/mailman/listinfo/libav-user That makes sense. I am using the example in the doc/examples directory. It uses fread(). Can you point me to an example that uses the avformat functions? I've been trying to find examples, but haven't had any luck. _______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
