Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Водянников А.В." <Aleksoid1978-at-mail.ru@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 2/2] mov: parse track-based udta name tags
Date: Sun, 25 Feb 2024 12:23:11 +1000
Message-ID: <cf58b232-818e-4ad2-bbac-a71e65873c8f@mail.ru> (raw)

[-- Attachment #1: 0002-mov-parse-track-based-udta-name-tags.patch --]
[-- Type: text/plain, Size: 2251 bytes --]

From 1833111ec9fe0350e9cf206bb33ca573b6b8c4b5 Mon Sep 17 00:00:00 2001
From: Aleksoid <Aleksoid1978@mail.ru>
Date: Sun, 25 Feb 2024 11:59:03 +1000
Subject: [PATCH 2/2] mov: parse track-based udta name tags

Signed-off-by: Aleksoid <Aleksoid1978@mail.ru>
---
 libavformat/mov.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1a1b104615..c7b6919433 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -301,6 +301,16 @@ static int mov_metadata_hmmt(MOVContext *c, AVIOContext *pb, unsigned len)
     return 0;
 }
 
+
+static void mov_set_metadata(MOVContext *c, const char *key, const char *str)
+{
+    if (c->trak_index >= 0) {
+        AVStream *st = c->fc->streams[c->fc->nb_streams-1];
+        av_dict_set(&st->metadata, key, str, 0);
+    } else
+        av_dict_set(&c->fc->metadata, key, str, 0);
+}
+
 static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     char tmp_key[AV_FOURCC_MAX_STRING_SIZE] = {0};
@@ -403,6 +413,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     case MKTAG(0xa9,'w','r','n'): key = "warning";   break;
     case MKTAG(0xa9,'w','r','t'): key = "composer";  break;
     case MKTAG(0xa9,'x','y','z'): key = "location";  break;
+    case MKTAG( 'n','a','m','e'): key = "title";     break;
     }
 retry:
     if (c->itunes_metadata && atom.size > 8) {
@@ -530,10 +541,10 @@ retry:
             str[str_size] = 0;
         }
         c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED;
-        av_dict_set(&c->fc->metadata, key, str, 0);
+        mov_set_metadata(c, key, str);
         if (*language && strcmp(language, "und")) {
             snprintf(key2, sizeof(key2), "%s-%s", key, language);
-            av_dict_set(&c->fc->metadata, key2, str, 0);
+            mov_set_metadata(c, key2, str);
         }
         if (!strcmp(key, "encoder")) {
             int major, minor, micro;
-- 
2.43.0.windows.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

                 reply	other threads:[~2024-02-25  2:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf58b232-818e-4ad2-bbac-a71e65873c8f@mail.ru \
    --to=aleksoid1978-at-mail.ru@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git