[FFmpeg-devel] MPEG-TS over UDP broken by r15739
Thu Nov 6 22:17:21 CET 2008
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:
>> 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
> 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.
More information about the ffmpeg-devel