changeset 3441:2d52ccde8f86 libavformat

pass extradata through ffm
author bcoudurier
date Mon, 09 Jun 2008 00:36:27 +0000
parents f9cf53254a61
children a6f4d53b738d
files ffmdec.c ffmenc.c
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ffmdec.c	Mon Jun 09 00:24:29 2008 +0000
+++ b/ffmdec.c	Mon Jun 09 00:36:27 2008 +0000
@@ -320,7 +320,13 @@
         default:
             goto fail;
         }
-
+        if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
+            codec->extradata_size = get_be32(pb);
+            codec->extradata = av_malloc(codec->extradata_size);
+            if (!codec->extradata)
+                return AVERROR(ENOMEM);
+            get_buffer(pb, codec->extradata, codec->extradata_size);
+        }
     }
 
     /* get until end of block reached */
--- a/ffmenc.c	Mon Jun 09 00:24:29 2008 +0000
+++ b/ffmenc.c	Mon Jun 09 00:36:27 2008 +0000
@@ -168,6 +168,10 @@
         default:
             return -1;
         }
+        if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
+            put_be32(pb, codec->extradata_size);
+            put_buffer(pb, codec->extradata, codec->extradata_size);
+        }
     }
 
     /* flush until end of block reached */