Skip to content

Commit

Permalink
mp3dec: export replaygain tags from ID3v2
Browse files Browse the repository at this point in the history
  • Loading branch information
elenril committed Mar 24, 2014
1 parent 06c3cd3 commit 15c5a8d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
version <next>:
- libx265 encoder
- shuffleplanes filter
- replaygain data export


version 10:
Expand Down
2 changes: 1 addition & 1 deletion libavformat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ OBJS-$(CONFIG_MOV_DEMUXER) += mov.o isom.o mov_chan.o
OBJS-$(CONFIG_MOV_MUXER) += movenc.o isom.o avc.o hevc.o \
movenchint.o mov_chan.o
OBJS-$(CONFIG_MP2_MUXER) += mp3enc.o rawenc.o id3v2enc.o
OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o
OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o replaygain.o
OBJS-$(CONFIG_MP3_MUXER) += mp3enc.o rawenc.o id3v2enc.o
OBJS-$(CONFIG_MPC_DEMUXER) += mpc.o apetag.o img2.o
OBJS-$(CONFIG_MPC8_DEMUXER) += mpc8.o apetag.o img2.o
Expand Down
7 changes: 7 additions & 0 deletions libavformat/mp3dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "internal.h"
#include "id3v2.h"
#include "id3v1.h"
#include "replaygain.h"

#include "libavcodec/mpegaudiodecheader.h"

#define XING_FLAG_FRAMES 0x01
Expand Down Expand Up @@ -194,6 +196,7 @@ static int mp3_read_header(AVFormatContext *s)
{
AVStream *st;
int64_t off;
int ret;

st = avformat_new_stream(s, NULL);
if (!st)
Expand All @@ -215,6 +218,10 @@ static int mp3_read_header(AVFormatContext *s)
if (mp3_parse_vbr_tags(s, st, off) < 0)
avio_seek(s->pb, off, SEEK_SET);

ret = ff_replaygain_export(st, s->metadata);
if (ret < 0)
return ret;

/* the parameters will be extracted from the compressed bitstream */
return 0;
}
Expand Down

0 comments on commit 15c5a8d

Please sign in to comment.