Skip to content

Commit d05e644

Browse files
committed
lame: Use libav wrapper to encode mp3lame
Fixes https://forum.handbrake.fr/viewtopic.php?f=12&t=33345 Some players expect each packet to start on an mp3 frame header. Our mp3lame encoder did not ensure this and resulted in failure to play audio on these players. libav already has the necessary code to parse headers and accumulate a full frame of data, so use it.
1 parent 7d77400 commit d05e644

File tree

6 files changed

+8
-232
lines changed

6 files changed

+8
-232
lines changed

contrib/ffmpeg/module.defs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ FFMPEG.CONFIGURE.extra = \
2727
--disable-network \
2828
--disable-hwaccels \
2929
--disable-encoders \
30+
--enable-libmp3lame \
3031
--enable-encoder=aac \
3132
--enable-encoder=ac3 \
3233
--enable-encoder=eac3 \
3334
--enable-encoder=flac \
3435
--enable-encoder=mpeg2video \
3536
--enable-encoder=mpeg4 \
37+
--enable-encoder=libmp3lame \
3638
--enable-libvpx \
3739
--enable-encoder=libvpx_vp8 \
3840
--disable-decoder=libvpx_vp8 \

libhb/common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,6 @@ extern hb_work_object_t hb_encx265;
11631163
extern hb_work_object_t hb_decavcodeca;
11641164
extern hb_work_object_t hb_decavcodecv;
11651165
extern hb_work_object_t hb_declpcm;
1166-
extern hb_work_object_t hb_enclame;
11671166
extern hb_work_object_t hb_encvorbis;
11681167
extern hb_work_object_t hb_muxer;
11691168
extern hb_work_object_t hb_encca_aac;

libhb/encavcodecaudio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ static int encavcodecaInit(hb_work_object_t *w, hb_job_t *job)
121121
}
122122
break;
123123

124+
case HB_ACODEC_LAME:
125+
codec_name = "libmp3lame";
126+
break;
127+
124128
default:
125129
hb_error("encavcodecaInit: unsupported codec (0x%x)",
126130
audio->config.out.codec);

libhb/enclame.c

Lines changed: 0 additions & 228 deletions
This file was deleted.

libhb/hb.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,6 @@ int hb_global_init()
16771677
hb_register(&hb_encca_aac);
16781678
hb_register(&hb_encca_haac);
16791679
#endif
1680-
hb_register(&hb_enclame);
16811680
hb_register(&hb_enctheora);
16821681
hb_register(&hb_encvorbis);
16831682
hb_register(&hb_encx264);

libhb/work.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ hb_work_object_t* hb_codec_encoder(hb_handle_t *h, int codec)
191191
}
192192
switch (codec)
193193
{
194-
case HB_ACODEC_AC3: return hb_get_work(h, WORK_ENCAVCODEC_AUDIO);
195-
case HB_ACODEC_LAME: return hb_get_work(h, WORK_ENCLAME);
194+
case HB_ACODEC_AC3:
195+
case HB_ACODEC_LAME: return hb_get_work(h, WORK_ENCAVCODEC_AUDIO);
196196
case HB_ACODEC_VORBIS: return hb_get_work(h, WORK_ENCVORBIS);
197197
case HB_ACODEC_CA_AAC: return hb_get_work(h, WORK_ENC_CA_AAC);
198198
case HB_ACODEC_CA_HAAC: return hb_get_work(h, WORK_ENC_CA_HAAC);

0 commit comments

Comments
 (0)