mpegtsparse: actually work when we have small buffers coming in

available_fast is not what we want and it will never get to discover packet
size if 188 byte buffers are being picked up.
This commit is contained in:
Zaheer Abbas Merali 2010-07-29 10:38:58 +01:00
parent b1240c850a
commit c7b195740e

View file

@ -2074,8 +2074,7 @@ mpegts_try_discover_packet_size (MpegTSPacketizer * packetizer)
}; };
/* wait for 3 sync bytes */ /* wait for 3 sync bytes */
/* so first return if there is not enough data for 4 * max packetsize */ /* so first return if there is not enough data for 4 * max packetsize */
if (gst_adapter_available_fast (packetizer->adapter) < if (gst_adapter_available (packetizer->adapter) < MPEGTS_MAX_PACKETSIZE * 4)
MPEGTS_MAX_PACKETSIZE * 4)
return; return;
/* check for sync bytes */ /* check for sync bytes */
dest = g_malloc (MPEGTS_MAX_PACKETSIZE * 4); dest = g_malloc (MPEGTS_MAX_PACKETSIZE * 4);