summaryrefslogtreecommitdiff
path: root/libavformat/oggparsevorbis.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-04 23:17:33 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-04 23:17:33 +0200
commit849a8c4cdb70f38a45ccd68d95c5ef3e87bd2815 (patch)
treea08e6b403a476a5dd9a72de4211d440c1152aa85 /libavformat/oggparsevorbis.c
parent8e8c8607fc23c9b9555ba62ffd66783339f38ee3 (diff)
parent0048deb84cb6d22ba7f4fd7c8b4ecc054fcc22d4 (diff)
downloadffmpeg-849a8c4cdb70f38a45ccd68d95c5ef3e87bd2815.tar.gz
Merge commit '0048deb84cb6d22ba7f4fd7c8b4ecc054fcc22d4'
* commit '0048deb84cb6d22ba7f4fd7c8b4ecc054fcc22d4': oggparsevorbis: export replaygain tags from Vorbis comments Conflicts: libavformat/Makefile libavformat/oggparsevorbis.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 57f0c6d29d..766f477ef2 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)
{
@@ -348,8 +349,14 @@ static int vorbis_header(AVFormatContext *s, int idx)
}
} else if (os->buf[os->pstart] == 3) {
if (vorbis_update_metadata(s, idx) >= 0 && priv->len[1] > 10) {
+ 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;