[vlc-devel] Re: Question about sout_buffer_t ...

John Michael Zorko j.zorko at att.net
Mon Sep 8 18:42:05 CEST 2003


Jean-Paul,

> I have been looking in the stream out code, and think the best place 
> could be in the packetiser (not the stream out). Basically, you need 
> to set it in the packet that is being formed, but you need to know 
> when to set it. The right place  is where the old pes/es structs are 
> still accessible for this packet.
> Look into modules/packetiser/*.{c,h} to see what I mean. (I am not 
> familiar with this code .. you are warned ;-))

I came to the same conclusion (first experiments setting TS 
discontinuity in the stream-out code didn't do so hot), so I put it in 
PacketizeThread().  It works there, but ...

>> Now, the muxer module's PacketizeThread() is happily looking in the 
>> decoder FIFO and making sout_buffer_t's out of what it finds in 
>> preparation for PEStoTS() to make TS packets out of them.  However, 
>> PacketizeThread() sees the decoder FIFO as a stream of bits, and i'm 
>> not sure how to make it identify the b_discontinuity flag in this 
>> bitstream, so it can set the flag in the sout_buffer_t.
>
> In the PacketizeThread() something like this:
>
> p_sout_buffer->b_discontinuity = 
> p_pack->sp_pack->p_first->b_discontinuity;
>
> at the appropriate place(s) ;-)

Well, I modified the bitstream stuff a bit (the struct has members for 
recently-found stuff, so I added a discontinuity flag member and set it 
when it found one ...

> input_NewPES() itself is the wrong place. It just allocates a new 
> buffer. But when the buffer is filled with the data, then the 
> p_sout_buffer pointer could be set with the b_discontinuity flag. 
> There is one problem though I do not know how the bitstream approach 
> relates to p_packet->p_first pointers. If the position in pes_packet_t 
> list can be obtained then the b_discontinuity flag can be copied. 
> Maybe someone else can comment on this (Meeuh, Sam?)?

Argh!  I went and modified input_NewPES() to accept the bool to set the 
discontinuity, but you're ideas here make a lot more sense, and 
besides, less code is changed (so when we merge with new versions of 
VLC, it should be easier).  I'll be changing my way to your way today 
...

> p_sout_buffer->b_discontinuity = 
> p_packet->bitstream->p_pes->b_discontinuity;

Brilliance :-)

Regards,

John

Falling You - exploring the beauty of voice and sound
New EP, "hope thrown down," available now at
http://www.mp3.com/fallingyou











-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list