On Fri, 20 Jun 2008 20:11:01 -0400, Tom Conerly <[EMAIL PROTECTED]>  
wrote:
> I have two AVFrame structs which I am switching between so that
> I can work on one frame while decoding the next frame. When I
> call avcodec_decode_video the struct holding the previous frame's
> data is changed (not the struct being passed to the function).

I've run into the same.  I'm pretty sure its by design.  It might help to  
think of the objects you get from libav more like views, and less like  
allocated objects.  (though they still need to be freed, to let the lib  
know that you are done looking at them)  Anyway, don't expect frames or  
packets to be preserved accross calls to the next function that returns  
one.  I think they do this to give codec and muxer implementors more  
freedom to optimize things, but yes, its annoying for people who are  
trying to parallelize.  In order to have more than one packet available at  
a time, you have to call av_dup_packet, and in order to have more than one  
decoded frame available at a time you need to call av_picture_copy.  (See  
respective documentation and/or source for how to use them)


-- 
Michael Conrad
IntelliTree Solutions llc.
513-552-6362
[EMAIL PROTECTED]
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to