Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/3] avformat/aeadec: Export title
@ 2024-03-15 16:42 Andreas Rheinhardt
  2024-03-15 16:43 ` [FFmpeg-devel] [PATCH 2/3] avformat/aeadec: Use sample rate as time base Andreas Rheinhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andreas Rheinhardt @ 2024-03-15 16:42 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/aeadec.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/libavformat/aeadec.c b/libavformat/aeadec.c
index 4cb2da6639..20170a89b3 100644
--- a/libavformat/aeadec.c
+++ b/libavformat/aeadec.c
@@ -23,6 +23,7 @@
 #include "libavutil/channel_layout.h"
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
+#include "avio_internal.h"
 #include "demux.h"
 #include "pcm.h"
 
@@ -59,12 +60,20 @@ static int aea_read_probe(const AVProbeData *p)
 static int aea_read_header(AVFormatContext *s)
 {
     AVStream *st = avformat_new_stream(s, NULL);
-    int channels;
+    char title[256 + 1];
+    int channels, ret;
     if (!st)
         return AVERROR(ENOMEM);
 
-    /* Parse the amount of channels and skip to pos 2048(0x800) */
-    avio_skip(s->pb, 264);
+    /* Read the title, parse the number of channels and skip to pos 2048(0x800) */
+    avio_rl32(s->pb); // magic
+    ret = ffio_read_size(s->pb, title, sizeof(title) - 1);
+    if (ret < 0)
+        return ret;
+    title[sizeof(title) - 1] = '\0';
+    if (title[0] != '\0')
+        av_dict_set(&st->metadata, "title", title, 0);
+    avio_rl32(s->pb); // Block count
     channels = avio_r8(s->pb);
     avio_skip(s->pb, 1783);
 
-- 
2.40.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".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-18  0:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-15 16:42 [FFmpeg-devel] [PATCH 1/3] avformat/aeadec: Export title Andreas Rheinhardt
2024-03-15 16:43 ` [FFmpeg-devel] [PATCH 2/3] avformat/aeadec: Use sample rate as time base Andreas Rheinhardt
2024-03-15 16:43 ` [FFmpeg-devel] [PATCH 3/3] fate/atrac: Add atrac->aea, atrac->matroska remux tests Andreas Rheinhardt
2024-03-18  0:52 ` [FFmpeg-devel] [PATCH 1/3] avformat/aeadec: Export title Andreas Rheinhardt

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