Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: =?us-ascii?B?PT9VVEYtOD9xP0FsYmVydG89MjBEZWxtPUMzPUExcz89?= <kostya.shishkov-Re5JQEeQqe8AvxtiuMwx3w <at> public.gmane.org>
Subject: [PATCH 2/2] an attempt to fix ASF demuxer from skipping small packets
Newsgroups: gmane.comp.video.libav.devel
Date: Thursday 23rd August 2012 18:09:35 UTC (over 4 years ago)
From: Alberto Delmás 
---
No idea about ASF but this help with small (7-byte) video packets being not
demuxed.
---
 libavformat/asfdec.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 2a3057d..6702f8b 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -95,7 +95,7 @@ static const AVClass asf_class = {
 #include 
 
 #define ASF_MAX_STREAMS 127
-#define FRAME_HEADER_SIZE 17
+#define FRAME_HEADER_SIZE 16
 // Fix Me! FRAME_HEADER_SIZE may be different.
 
 static const ff_asf_guid index_guid = {
@@ -1010,7 +1010,7 @@ static int ff_asf_parse_packet(AVFormatContext *s,
AVIOContext *pb, AVPacket *pk
         if(pb->eof_reached)
             return AVERROR_EOF;
         if (asf->packet_size_left < FRAME_HEADER_SIZE
-            || asf->packet_segments < 1) {
+            || asf->packet_segments < 1 && asf->packet_time_start == 0) {
             //asf->packet_size_left <= asf->packet_padsize) {
             int ret = asf->packet_size_left + asf->packet_padsize;
             //printf("PacketLeftSize:%d  Pad:%d Pos:%"PRId64"\n",
asf->packet_size_left, asf->packet_padsize, avio_tell(pb));
@@ -1026,7 +1026,7 @@ static int ff_asf_parse_packet(AVFormatContext *s,
AVIOContext *pb, AVPacket *pk
         }
         if (asf->packet_time_start == 0) {
             if(asf_read_frame_header(s, pb) < 0){
-                asf->packet_segments= 0;
+                asf->packet_segments = asf->packet_time_start = 0;
                 continue;
             }
             if (asf->stream_index < 0
-- 
1.7.0.4
 
CD: 2ms