[FFmpeg-devel] MPEG-TS over UDP broken by r15739

Jindrich Makovicka makovick
Mon Nov 10 10:08:38 CET 2008


2008/11/7 Michael Niedermayer <michaelni at gmx.at>:
> On Thu, Nov 06, 2008 at 10:17:21PM +0100, Jindrich Makovicka wrote:
>> On Thu, Nov 6, 2008 at 18:28, Michael Niedermayer <michaelni at gmx.at> wrote:
>> > On Fri, Oct 31, 2008 at 04:31:01PM +0100, Jindrich Makovicka wrote:
>> >> Hi,
>> >>
>> >> revision 15739 broke receiving datagram based inputs like UDP - aviobuf
>> >> now discards parts of the packets. Maybe it could be fixed by the
>> >> attached patch that reverts to the old behavior if max_packet_size is
>> >> specified.
>> >
>> > Well, the bug has to be analyzed first.
>> > Just "reverting to the old behavior if ..." is really not how we should
>> > fix and justify fixes.
>>
>> Now, the code is clearly broken wrt/ datagram inputs because with a
>> partially filled buffer, recv() can (and will) truncate the received
>> UDP packets, and the TS demuxer will get garbage on its input. By
>> reverting to the old behavior, we ensure that the received packet will
>> fit into the buffer, which is exactly max_packet_size long. As long as
>> we assume that having one packet in the buffer is enough for format
>> autodetection, the fix is ok.
>
> understood, thanks for explaining.
> i agree with the idea of your solution but its mildly buggy, probably doing
> something random with checksuming also its more complex than needed
>
> i think
> simply changing dst at its initialization should be all that is needed for
> no max_packet_size case.

Right, this is a lot simpler and works as well.

-- 
Jindrich Makovicka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aviobuf.c.2.diff
Type: text/x-diff
Size: 502 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081110/5c11826c/attachment.diff>



More information about the ffmpeg-devel mailing list