aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-07-21 08:54:39 +0000
committerGravatar alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-07-21 08:54:39 +0000
commitf6127f873731cb55f03216fbd51cdc20bc3e4265 (patch)
tree638574a0bd4165b3b305e925ec9225ee063e8a86
parenta3337af70b38477898a3628fe59c1ecb6e85a148 (diff)
skip ecc only if present, patch by Alexis Durelle <alexis.durelle@cen.cnamts.fr> (needed for the Aiptek DV3500 camera)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12878 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libmpdemux/demux_asf.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libmpdemux/demux_asf.c b/libmpdemux/demux_asf.c
index 0c28430bed..842d7577f5 100644
--- a/libmpdemux/demux_asf.c
+++ b/libmpdemux/demux_asf.c
@@ -152,8 +152,8 @@ int demux_asf_fill_buffer(demuxer_t *demux){
stream_read(demux->stream,asf_packet,asf_packetsize);
if(demux->stream->eof) return 0; // EOF
- { unsigned char ecc_flags=asf_packet[0];
- unsigned char* p=&asf_packet[1+(ecc_flags&15)];
+ {
+ unsigned char* p=asf_packet;
unsigned char* p_end=asf_packet+asf_packetsize;
unsigned char flags=p[0];
unsigned char segtype=p[1];
@@ -173,6 +173,16 @@ int demux_asf_fill_buffer(demuxer_t *demux){
printf("\n");
}
+ // skip ECC data if present by testing bit 7 of flags
+ // 1xxxbbbb -> ecc data present, skip bbbb byte(s)
+ // 0xxxxxxx -> payload parsing info starts
+ if (flags & 0x80)
+ {
+ p += (flags & 0x0f)+1;
+ flags = p[0];
+ segtype = p[1];
+ }
+
//if(segtype!=0x5d) printf("Warning! packet[4] != 0x5d \n");
p+=2; // skip flags & segtype