Commit 5d79a073 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/asfdec_f: Do not print errors if packets do not start with ECC

There is nothing wrong with such packets, the spec allows this
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 385eb066
...@@ -113,6 +113,8 @@ typedef struct ASFContext { ...@@ -113,6 +113,8 @@ typedef struct ASFContext {
int no_resync_search; int no_resync_search;
int export_xmp; int export_xmp;
int uses_std_ecc;
} ASFContext; } ASFContext;
static const AVOption options[] = { static const AVOption options[] = {
...@@ -956,6 +958,7 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb) ...@@ -956,6 +958,7 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
int rsize = 8; int rsize = 8;
int c, d, e, off; int c, d, e, off;
if (asf->uses_std_ecc >= 0) {
// if we do not know packet size, allow skipping up to 32 kB // if we do not know packet size, allow skipping up to 32 kB
off = 32768; off = 32768;
if (asf->no_resync_search) if (asf->no_resync_search)
...@@ -972,6 +975,10 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb) ...@@ -972,6 +975,10 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
break; break;
} }
if (!asf->uses_std_ecc) {
asf->uses_std_ecc = (c == 0x82 && !d && !e) ? 1 : -1;
}
if (c != 0x82) { if (c != 0x82) {
/* This code allows handling of -EAGAIN at packet boundaries (i.e. /* This code allows handling of -EAGAIN at packet boundaries (i.e.
* if the packet sync code above triggers -EAGAIN). This does not * if the packet sync code above triggers -EAGAIN). This does not
...@@ -995,6 +1002,10 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb) ...@@ -995,6 +1002,10 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
} else if(!avio_feof(pb)) { } else if(!avio_feof(pb)) {
avio_seek(pb, -1, SEEK_CUR); // FIXME avio_seek(pb, -1, SEEK_CUR); // FIXME
} }
} else {
c = avio_r8(pb);
d = avio_r8(pb);
}
asf->packet_flags = c; asf->packet_flags = c;
asf->packet_property = d; asf->packet_property = d;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment