[SCM] libav/experimental: wtv: do not repopulate codec information after we have seen data chunks

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:21:37 UTC 2013


The following commit has been merged in the experimental branch:
commit a5a36a7970962007e1384ee036c2f50f9884421b
Author: Peter Ross <pross at xvid.org>
Date:   Sun Jan 9 02:35:06 2011 +0000

    wtv: do not repopulate codec information after we have seen data chunks
    
    Originally committed as revision 26276 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/wtv.c b/libavformat/wtv.c
index 0e7db98..5d78470 100644
--- a/libavformat/wtv.c
+++ b/libavformat/wtv.c
@@ -37,6 +37,10 @@
 #define ARG_GUID(g) \
     g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]
 
+typedef struct {
+    int seen_data;
+} WtvStream;
+
 typedef struct WtvContext {
     uint64_t pts;
 } WtvContext;
@@ -207,9 +211,13 @@ static AVStream * new_stream(AVFormatContext *s, AVStream *st, int sid, int code
             st->codec->extradata_size = 0;
         }
     } else {
+        WtvStream *wst = av_mallocz(sizeof(WtvStream));
+        if (!wst)
+            return NULL;
         st = av_new_stream(s, sid);
         if (!st)
             return NULL;
+        st->priv_data = wst;
     }
     st->codec->codec_type = codec_type;
     st->need_parsing      = AVSTREAM_PARSE_FULL;
@@ -388,7 +396,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
             }
         } else if (!ff_guidcmp(g, stream2_guid)) {
             int stream_index = ff_find_stream_index(s, sid);
-            if (stream_index >= 0) {
+            if (stream_index >= 0 && !((WtvStream*)s->streams[stream_index]->priv_data)->seen_data) {
                 ff_asf_guid mediatype, subtype, formattype;
                 int size;
                 url_fskip(pb, 12);
@@ -461,6 +469,8 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
         } else if (!ff_guidcmp(g, data_guid)) {
             int stream_index = ff_find_stream_index(s, sid);
             if (mode == SEEK_TO_DATA && stream_index >= 0) {
+                WtvStream *wst = s->streams[stream_index]->priv_data;
+                wst->seen_data = 1;
                 if (len_ptr) {
                     *len_ptr = len;
                 }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list