On Tue, 24 Jun 2008 04:41:19 -0400, evgeni shafran <[EMAIL PROTECTED]>  
wrote:
> If I simply copy the AVPacket structures, without duplicating (via
> av_dup_packet) the data buffer, and let write_packet() change the various
> structure details, will it still work?

Can't say for sure, since I've never done encoding, but I would assume  
that write_packet does not alter the data in the packet's buffer.  So yes,  
if you are using only one packet at a time from av_read_frame, and then  
copying the struct and sending it to write_packet, I would expect it to  
work without needing av_dup_packet inbetween.

(also, even if you didn't copy the struct it should work, since  
av_read_frame doesn't care what the fields of the packet struct contain  
when the function is called)

>
>
> On Mon, Jun 23, 2008 at 11:11 PM, Michael Conrad  
> <[EMAIL PROTECTED]>
> wrote:
>
>> On Mon, 23 Jun 2008 03:29:43 -0400, evgeni shafran <[EMAIL PROTECTED]>
>> wrote:
>>
>> > its dont work for me... i made 3 packets and compared each of them  
>> with
>> > the
>> > same packet and after each compare i duplecated them
>> > and still when i change one pts, they all changes
>> >
>>
>> Can you be more specific?  It sounds like you have just made 3 copies  
>> of a
>> pointer to a packet.  The pts field of a packet is not dynamically
>> allocated, so it cannot be shared between two packet structs.
>>

-- 
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