[Ffmpeg-devel] [PATCH] Which Vorbis encoder by default
Oded Shimon
ods15
Mon Oct 2 17:13:08 CEST 2006
On Mon, Oct 02, 2006 at 04:53:23PM +0200, Oded Shimon wrote:
> Right now, the only way to get ffmpeg to use the library vorbis encoder is
> to manually disable the native one.
> I'm thinking maybe the default vorbis encoder should be the library one,
> and the way to choose the native one would be with -acodec vorbis_native .
> You'd still need to use --enable-libogg --enable-vorbis to get the library
> one, just like before... But if you didn't, there would be no "vorbis"
> encoder at all, just "vorbis_native".
Different patch - there will always be a "vorbis" encoder, which one it is
depends on if ffmpeg was compiled with --enable-vorbis or not (which is
now a misleading option name btw, it should be --enable-libvorbis), and
there will always be a "vorbis_native" encoder. Is this acceptable?
- ods15
-------------- next part --------------
Index: allcodecs.c
===================================================================
--- allcodecs.c (revision 6525)
+++ allcodecs.c (working copy)
@@ -50,10 +50,10 @@
register_avcodec(&mp3lame_encoder);
#endif //CONFIG_MP3LAME_ENCODER
#endif
-#ifdef CONFIG_LIBVORBIS
-#if (defined CONFIG_OGGVORBIS_ENCODER && !defined CONFIG_VORBIS_ENCODER)
+#ifdef CONFIG_OGGVORBIS_ENCODER
register_avcodec(&oggvorbis_encoder);
#endif //CONFIG_OGGVORBIS_ENCODER
+#ifdef CONFIG_LIBVORBIS
#if (defined CONFIG_OGGVORBIS_DECODER && !defined CONFIG_VORBIS_DECODER)
register_avcodec(&oggvorbis_decoder);
#endif //CONFIG_OGGVORBIS_DECODER
Index: Makefile
===================================================================
--- Makefile (revision 6525)
+++ Makefile (working copy)
@@ -123,6 +123,7 @@
OBJS-$(CONFIG_VMNC_DECODER) += vmnc.o
OBJS-$(CONFIG_VORBIS_DECODER) += vorbis.o vorbis_data.o
OBJS-$(CONFIG_VORBIS_ENCODER) += vorbis_enc.o vorbis_data.o
+OBJS-$(CONFIG_OGGVORBIS_ENCODER) += vorbis_enc.o vorbis_data.o
OBJS-$(CONFIG_VP3_DECODER) += vp3.o
OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o
OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o
Index: avcodec.h
===================================================================
--- avcodec.h (revision 6525)
+++ avcodec.h (working copy)
@@ -203,6 +203,7 @@
CODEC_ID_AC3,
CODEC_ID_DTS,
CODEC_ID_VORBIS,
+ CODEC_ID_VORBIS_NATIVE,
CODEC_ID_DVAUDIO,
CODEC_ID_WMAV1,
CODEC_ID_WMAV2,
Index: vorbis_enc.c
===================================================================
--- vorbis_enc.c (revision 6527)
+++ vorbis_enc.c (working copy)
@@ -1074,6 +1074,18 @@
}
AVCodec vorbis_encoder = {
+ "vorbis_native",
+ CODEC_TYPE_AUDIO,
+ CODEC_ID_VORBIS_NATIVE,
+ sizeof(venc_context_t),
+ vorbis_encode_init,
+ vorbis_encode_frame,
+ vorbis_encode_close,
+ .capabilities= CODEC_CAP_DELAY,
+};
+
+#ifndef CONFIG_LIBVORBIS
+AVCodec oggvorbis_encoder = {
"vorbis",
CODEC_TYPE_AUDIO,
CODEC_ID_VORBIS,
@@ -1083,3 +1095,4 @@
vorbis_encode_close,
.capabilities= CODEC_CAP_DELAY,
};
+#endif
More information about the ffmpeg-devel
mailing list