[MPlayer-dev-eng] PATCH: refcounting for demux_packet_t

Alexander Neundorf neundorf at dellingsoft.de
Thu May 23 10:34:25 CEST 2002


Hi,

finally I have my raw dv support working, but still with a quite old (end of 
february) version of mplayer, I still have to port it to a current version 
somewhen.

Well, here is the first part, reference counting for demux_packet_t, so that 
the fat dv stream doesn't have to be copied twice through mplayer.
It introduces a new function 

demux_packet_t clone_demux_packet(demux_packet_t *p);
which creates a new demux_packet, but doesn't malloc() the buffer, but points 
to the buffer of p. If p itself is already cloned, it points to the "master" 
packet of p. The refcount of the "master" packet is increased.
The p->buffer must not (or was it "may not" ?) free()'d, since this destroys 
the refcounting. free_demux_packet() has to be used always. That's why a 
demux_packet_t* ds->buffer_ref; had to be inserted in demux_stream_t.

It works for me, I hope I found most issues.

Bye
Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demuxer.h.diff
Type: text/x-c++
Size: 2149 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20020523/4e382907/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demuxer.c.diff
Type: text/x-c++
Size: 2271 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20020523/4e382907/attachment-0001.bin>


More information about the MPlayer-dev-eng mailing list