[FFmpeg-devel] avformat/wavdec: add support for 'id3 ' chunk

Submitted by Paul B Mahol on Dec. 12, 2018, 6:08 p.m.

Details

Message ID 20181212180816.17410-1-onemda@gmail.com
State Accepted
Headers show

Commit Message

Paul B Mahol Dec. 12, 2018, 6:08 p.m.
Fixes #5700.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavformat/wavdec.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Michael Niedermayer Dec. 12, 2018, 11:47 p.m.
On Wed, Dec 12, 2018 at 07:08:16PM +0100, Paul B Mahol wrote:
> Fixes #5700.
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavformat/wavdec.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)

patch probably ok
a fate test would be usefull for this and other bugfixes/features

thanks

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index e280be4d44..6ab0a49313 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -34,6 +34,7 @@ 
 #include "avformat.h"
 #include "avio.h"
 #include "avio_internal.h"
+#include "id3v2.h"
 #include "internal.h"
 #include "metadata.h"
 #include "pcm.h"
@@ -500,6 +501,17 @@  static int wav_read_header(AVFormatContext *s)
                 ff_read_riff_info(s, size - 4);
             }
             break;
+        case MKTAG('i', 'd', '3', ' '): {
+            ID3v2ExtraMeta *id3v2_extra_meta = NULL;
+            ff_id3v2_read_dict(pb, &s->internal->id3v2_meta, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
+            if (id3v2_extra_meta) {
+                ff_id3v2_parse_apic(s, &id3v2_extra_meta);
+                ff_id3v2_parse_chapters(s, &id3v2_extra_meta);
+                ff_id3v2_parse_priv(s, &id3v2_extra_meta);
+            }
+            ff_id3v2_free_extra_meta(&id3v2_extra_meta);
+            }
+            break;
         }
 
         /* seek to next tag unless we know that we'll run into EOF */