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

Michael Niedermayer michaelni
Fri Nov 7 01:31:07 CET 2008

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.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081107/15ce18c6/attachment.pgp>

More information about the ffmpeg-devel mailing list