aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/oggparsevorbis.c
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@ghedini.me>2014-04-04 11:50:46 +0200
committerAnton Khirnov <anton@khirnov.net>2014-04-04 17:40:51 +0200
commit0048deb84cb6d22ba7f4fd7c8b4ecc054fcc22d4 (patch)
tree0937d2fe711e90d00e06804cb564a546e36892d2 /libavformat/oggparsevorbis.c
parent1d55f8d5f6f2cd74fa27170e2be37a72441d9202 (diff)
downloadffmpeg-0048deb84cb6d22ba7f4fd7c8b4ecc054fcc22d4.tar.gz
oggparsevorbis: export replaygain tags from Vorbis comments
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/oggparsevorbis.c')
-rw-r--r--libavformat/oggparsevorbis.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index c19b54552c..3eac0ba083 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -36,6 +36,7 @@
#include "internal.h"
#include "oggdec.h"
#include "vorbiscomment.h"
+#include "replaygain.h"
static int ogm_chapter(AVFormatContext *as, uint8_t *key, uint8_t *val)
{
@@ -305,8 +306,14 @@ static int vorbis_header(AVFormatContext *s, int idx)
if (os->psize > 8 &&
ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7,
os->psize - 8) >= 0) {
+ unsigned new_len;
+
+ int ret = ff_replaygain_export(st, st->metadata);
+ if (ret < 0)
+ return ret;
+
// drop all metadata we parsed and which is not required by libvorbis
- unsigned new_len = 7 + 4 + AV_RL32(priv->packet[1] + 7) + 4 + 1;
+ new_len = 7 + 4 + AV_RL32(priv->packet[1] + 7) + 4 + 1;
if (new_len >= 16 && new_len < os->psize) {
AV_WL32(priv->packet[1] + new_len - 5, 0);
priv->packet[1][new_len - 1] = 1;