[FFmpeg-devel] [PATCH 0/3] Fix gapless encoding/decoding for MP3

Jon Toohill jtoohill at google.com
Tue Oct 4 03:45:05 EEST 2016


Round trip wav->mp3->wav now preserves the correct number of samples.
Remuxing mp3->mp3 with -c:a copy also preserves any existing gapless
metadata in the Info tag.

The code in libmp3lame.c to set AV_PKT_DATA_SKIP_SAMPLES was mostly
copied from libopusenc.c.

Jon Toohill (3):
  lavc/libmp3lame: send encoder padding in side data of final packet
  lavf/mp3enc: write encoder delay/padding upon closing
  lavf/mp3dec: read encoder delay/padding from Info tag

 libavcodec/libmp3lame.c              | 21 ++++++++++++++++++++-
 libavformat/mp3dec.c                 |  3 ++-
 libavformat/mp3enc.c                 | 32 +++++++++++++++++++++++++-------
 tests/ref/fate/audiomatch-square-mp3 |  2 +-
 tests/ref/fate/gapless-mp3           | 10 +++++-----
 5 files changed, 53 insertions(+), 15 deletions(-)

-- 
2.8.0.rc3.226.g39d4020



More information about the ffmpeg-devel mailing list