[FFmpeg-cvslog] flvdec: Interpret a toplevel 'object' type metadata item as normal metadata , too

Martin Storsjö git at videolan.org
Wed Feb 1 03:06:29 CET 2012


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon Jan 30 22:47:40 2012 +0200| [89f6e8a20c07ad779ca374fdc5b16a22a37a6150] | committer: Martin Storsjö

flvdec: Interpret a toplevel 'object' type metadata item as normal metadata, too

Previously, we've only passed the key string on to the recursive
amf_parse_object for the mixedarray type, not for 'object'. By
passing the key string on, the recursive amf_parse_object can
store the amf objects as metadata.

This kind of data was seen in data from XSplit Broadcaster, received
over RTMP via Wowza. This patch allows reading this metadata.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=89f6e8a20c07ad779ca374fdc5b16a22a37a6150
---

 libavformat/flvdec.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 9296ef9..ad38653 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -240,22 +240,18 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
             if(amf_get_string(ioc, str_val, sizeof(str_val)) < 0)
                 return -1;
             break;
-        case AMF_DATA_TYPE_OBJECT: {
-            unsigned int keylen;
-
+        case AMF_DATA_TYPE_OBJECT:
             if ((vstream || astream) && key && !strcmp(KEYFRAMES_TAG, key) && depth == 1)
                 if (parse_keyframes_index(s, ioc, vstream ? vstream : astream,
                                           max_pos) < 0)
                     return -1;
 
-            while(avio_tell(ioc) < max_pos - 2 && (keylen = avio_rb16(ioc))) {
-                avio_skip(ioc, keylen); //skip key string
-                if(amf_parse_object(s, NULL, NULL, NULL, max_pos, depth + 1) < 0)
+            while (avio_tell(ioc) < max_pos - 2 && amf_get_string(ioc, str_val, sizeof(str_val)) > 0) {
+                if (amf_parse_object(s, astream, vstream, str_val, max_pos, depth + 1) < 0)
                     return -1; //if we couldn't skip, bomb out.
             }
             if(avio_r8(ioc) != AMF_END_OF_OBJECT)
                 return -1;
-        }
             break;
         case AMF_DATA_TYPE_NULL:
         case AMF_DATA_TYPE_UNDEFINED:



More information about the ffmpeg-cvslog mailing list