[vlc-devel] [PATCH 1/3] asf: Fix packet length handling to be correct

Juho Vähä-Herttua juhovh at iki.fi
Fri Jul 16 13:50:51 CEST 2010


---
 modules/demux/asf/asf.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index e408296..9294d22 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -466,11 +466,17 @@ static int DemuxPacket( demux_t *p_demux )
         goto loop_error_recovery;
     }
 
+    if( i_packet_length < i_data_packet_min )
+    {
+        /* if packet length too short, there is extra padding */
+        i_packet_padding_length += i_data_packet_min - i_packet_length;
+        i_packet_length = i_data_packet_min;
+    }
+
     i_packet_send_time = GetDWLE( p_peek + i_skip ); i_skip += 4;
     i_packet_duration  = GetWLE( p_peek + i_skip ); i_skip += 2;
 
-    /* FIXME I have to do that for some file, I don't known why */
-    i_packet_size_left = i_data_packet_min /*i_packet_length*/ ;
+    i_packet_size_left = i_packet_length;
 
     if( b_packet_multiple_payload )
     {
-- 
1.7.0.4




More information about the vlc-devel mailing list