It must be extended to support subtitle-like features.
---
 libavformat/flvdec.c |    6 +++---
 libavformat/flvenc.c |    8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 48933f3..006a73a 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -365,7 +365,7 @@ static int flv_read_metabody(AVFormatContext *s, int64_t 
next_pos) {
         amf_get_string(ioc, buffer, sizeof(buffer)) < 0)
         return -1;
 
-    if (!strcmp(buffer, "onFI"))
+    if (!strcmp(buffer, "onTextData"))
         return 1;
 
     if (strcmp(buffer, "onMetaData"))
@@ -485,12 +485,12 @@ static int flv_data_packet(AVFormatContext *s, AVPacket 
*pkt,
     else if (type != AMF_DATA_TYPE_OBJECT)
         goto out;
     amf_get_string(pb, buf, sizeof(buf));
-    if (strcmp(buf,"sd") || avio_r8(pb) != AMF_DATA_TYPE_STRING)
+    if (strcmp(buf,"type") || avio_r8(pb) != AMF_DATA_TYPE_STRING)
         goto out;
     amf_get_string(pb, buf, sizeof(buf));
     //FIXME parse it as codec_id
     amf_get_string(pb, buf, sizeof(buf));
-    if (strcmp(buf,"st") || avio_r8(pb) != AMF_DATA_TYPE_STRING)
+    if (strcmp(buf,"text") || avio_r8(pb) != AMF_DATA_TYPE_STRING)
         goto out;
     length = avio_rb16(pb);
     ret = av_get_packet(s->pb, pkt, length);
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index d647852..59fb0d4 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -481,13 +481,13 @@ static int flv_write_packet(AVFormatContext *s, AVPacket 
*pkt)
         int data_size;
         int metadata_size_pos = avio_tell(pb);
         avio_w8(pb, AMF_DATA_TYPE_STRING);
-        put_amf_string(pb, "onFI");
+        put_amf_string(pb, "onTextData");
         avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY);
         avio_wb32(pb, 2);
-        put_amf_string(pb, "sd");
+        put_amf_string(pb, "type");
         avio_w8(pb, AMF_DATA_TYPE_STRING);
-        put_amf_string(pb, "Dummy");
-        put_amf_string(pb, "st");
+        put_amf_string(pb, "Text");
+        put_amf_string(pb, "text");
         avio_w8(pb, AMF_DATA_TYPE_STRING);
         put_amf_string(pb, pkt->data);
         put_amf_string(pb, "");
-- 
1.7.8.rc1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to