[FFmpeg-devel] Patch update

Clément Bœsch ubitux at gmail.com
Fri Feb 22 02:37:42 CET 2013


On Fri, Feb 22, 2013 at 01:25:40AM +0000, Colin NG wrote:
> 
> Hi all,
> 
> Here is my refined patch for ticket #2230. The patch fixes the failure to write out non-default metadata into segment‏ header in HLS creation.  Please review and give me feedback.
> 

OK so it seems you need some little help:

 - Please do not top post here, it is considered rude. If you do not know
   what it means, observe how people are exchanging mails on this
   mailing-list. Also, Google may give you hints.

 - Your patch is not supposed to be encoded in base64

 - Your base64 mess includes a totally unrelated patch already upstream
   for a strange reason.

Since all of this is getting quite frustrating for everybody, I believe
what you want for review is the patch as attached to this mail.

Regards,

-- 
Clément B.
-------------- next part --------------
From 692ad5a3cd3a7181abca54c467b171540ab3a0b3 Mon Sep 17 00:00:00 2001
From: Colin Ng <colin_ng at hotmail.com>
Date: Thu, 21 Feb 2013 16:33:47 -0800
Subject: [PATCH] hls: Fix the failure to write out non-default metadata into
 segment header

---
 libavformat/segment.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 mode change 100644 => 100755 libavformat/segment.c

diff --git a/libavformat/segment.c b/libavformat/segment.c
old mode 100644
new mode 100755
index 13d8c43..f6f397c
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -174,11 +174,23 @@ static int segment_start(AVFormatContext *s, int write_header)
     int err = 0;
 
     if (write_header) {
+
+        AVDictionary *tmp = NULL;
+
+        if (av_dict_count(s->metadata) > 0) {
+            av_dict_copy(&tmp, s->metadata, 0);
+        } else if (av_dict_count(oc->metadata) > 0) {
+            av_dict_copy(&tmp, oc->metadata, 0);
+        }
+
         avformat_free_context(oc);
         seg->avf = NULL;
         if ((err = segment_mux_init(s)) < 0)
             return err;
+
         oc = seg->avf;
+
+        av_dict_copy(&oc->metadata, tmp, 0);
     }
 
     seg->segment_idx++;
@@ -595,6 +607,8 @@ static int seg_write_header(AVFormatContext *s)
             goto fail;
     }
 
+    av_dict_copy(&oc->metadata, s->metadata, 0);
+
     if ((ret = avformat_write_header(oc, NULL)) < 0) {
         avio_close(oc->pb);
         goto fail;
-- 
1.8.1.4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130222/30dd6615/attachment.asc>


More information about the ffmpeg-devel mailing list