Merge commit '0048deb84cb6d22ba7f4fd7c8b4ecc054fcc22d4'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 4 Apr 2014 21:17:33 +0000 (23:17 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 4 Apr 2014 21:17:33 +0000 (23:17 +0200)
* commit '0048deb84cb6d22ba7f4fd7c8b4ecc054fcc22d4':
  oggparsevorbis: export replaygain tags from Vorbis comments

Conflicts:
libavformat/Makefile
libavformat/oggparsevorbis.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/Makefile
libavformat/oggparsevorbis.c

@@@ -266,7 -221,7 +266,8 @@@ OBJS-$(CONFIG_OGG_DEMUXER
                                              oggparsespeex.o  \
                                              oggparsetheora.o \
                                              oggparsevorbis.o \
 +                                            oggparsevp8.o    \
+                                             replaygain.o     \
                                              vorbiscomment.o  \
                                              flac_picture.o
  OBJS-$(CONFIG_OGG_MUXER)                 += oggenc.o \
@@@ -347,9 -303,17 +348,15 @@@ static int vorbis_header(AVFormatContex
              avpriv_set_pts_info(st, 64, 1, srate);
          }
      } else if (os->buf[os->pstart] == 3) {
 -        if (os->psize > 8 &&
 -            ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7,
 -                              os->psize - 8) >= 0) {
 +        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;