changeset 18461:e98125844f2d

don't allocate (and demux_push() immediately) demux_packet()s > MAX_PACK_SIZE; releasing immediately audio packets (before the pes is complete) doesn't make any sense and deteriorates interleaving
author nicodvb
date Fri, 12 May 2006 21:34:06 +0000
parents 6853dc0411c1
children 557d188e915a
files libmpdemux/demux_ts.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ts.c	Fri May 12 20:26:05 2006 +0000
+++ b/libmpdemux/demux_ts.c	Fri May 12 21:34:06 2006 +0000
@@ -2823,6 +2823,8 @@
 
 			if(*dp == NULL)
 			{
+				if(*buffer_size > MAX_PACK_BYTES)
+					*buffer_size = MAX_PACK_BYTES;
 				*dp = new_demux_packet(*buffer_size);	//es->size
 				*dp_offset = 0;
 				if(! *dp)
@@ -2930,7 +2932,7 @@
 						(*dp)->pos = stream_tell(demuxer->stream);
 						(*dp)->pts = es->pts;
 
-				if(is_audio)
+				if(*dp_offset >= MAX_PACK_BYTES)
 				{
 					retv = fill_packet(demuxer, ds, dp, dp_offset, si);
 					return 1;
@@ -3002,7 +3004,7 @@
 				}
 				stream_skip(stream, junk);
 
-				if(is_audio)
+				if(*dp_offset >= MAX_PACK_BYTES)
 				{
 					(*dp)->pts = tss->last_pts;
 					retv = fill_packet(demuxer, ds, dp, dp_offset, si);