[MPlayer-dev-eng] Add demux_nut to libmpdemux

Oded Shimon ods15 at ods15.dyndns.org
Fri Sep 15 15:59:44 CEST 2006


On Fri, Sep 15, 2006 at 04:26:35PM +0300, Uoti Urpala wrote:
> On Fri, 2006-09-15 at 16:21 +0300, Oded Shimon wrote:
> > Like I said, I just wanted to move out demux_nut.c from NUT repo, it's not 
> > exactly production ready.. Though it does work :)
> 
> Is it ready to be committed then? IMO the MPlayer repository is not a
> place for private development versions, and just wanting to move
> something out of the NUT repo is not a reason to put it in the MPlayer
> repo.

It's good enough. It has a few minor FIXME's, but it plays, auto-detects, 
seeks, closes, and anything you'd expect from a demuxer...

Here's my do-over. Did the best I could with the 80-width thing, and added 
configure change. Never hacked on configure script, please tell me if I 
did it correctly...

- ods15
-------------- next part --------------
Index: Makefile
===================================================================
--- Makefile	(revision 19814)
+++ Makefile	(working copy)
@@ -110,6 +110,7 @@
              $(X264_LIB) \
              $(MUSEPACK_LIB) \
              $(SPEEX_LIB) \
+             $(NUT_LIB) \
 
 ifeq ($(TOOLAME),yes)
 CODEC_LIBS += $(TOOLAME_LIB)
Index: configure
===================================================================
--- configure	(revision 19814)
+++ configure	(working copy)
@@ -263,6 +263,7 @@
   --disable-real         disable RealPlayer DLL support [autodetect]
   --disable-xvid         disable XviD codec [autodetect]
   --disable-x264         disable H.264 encoder [autodetect]
+  --disable-nut          disable libnut demuxer [autodetect]
   --disable-libavutil    disable libavutil [autodetect]
   --disable-libavcodec   disable libavcodec [autodetect]
   --disable-libavformat  disable libavformat [autodetect]
@@ -1667,6 +1668,7 @@
 _joystick=no
 _xvid=auto
 _x264=auto
+_nut=auto
 _lirc=auto
 _lircc=auto
 _gui=no
@@ -1925,6 +1927,8 @@
   --disable-xvid)	_xvid=no	;;
   --enable-x264)        _x264=yes       ;;
   --disable-x264)       _x264=no        ;;
+  --enable-nut)		_nut=yes	;;
+  --disable-nut)	_nut=no		;;
   --enable-libavutil)	_libavutil=yes	;;
   --disable-libavutil)	_libavutil=no	;;
   --enable-libavutil_so)	_libavutil_so=yes	;;
@@ -6514,6 +6518,29 @@
 echores "$_x264"
 
 
+echocheck "nut"
+if test "$_nut" = auto ; then
+  cat > $TMPC << EOF
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <nut.h>
+int main(void) { (void)nut_error(0); return 0; }
+EOF
+  _ld_nut="$_ld_nut -lnut"
+  _nut=no
+   cc_check $_ld_nut && _nut=yes
+fi
+
+if test "$_nut" = yes ; then
+  _def_nut='#define HAVE_LIBNUT 1'
+else
+  _ld_nut=''
+  _def_nut='#undef HAVE_LIBNUT'
+fi
+echores "$_nut"
+
+
 # mencoder requires (optional) those libs: libmp3lame
 if test "$_mencoder" != no ; then
 
@@ -7472,6 +7499,8 @@
 XVID_LIB = $_ld_xvid
 X264 = $_x264
 X264_LIB = $_ld_x264
+LIBNUT = $_nut
+NUT_LIB = $_ld_nut
 CONFIG_DTS = $_libdts
 DTS_LIB = $_ld_libdts
 DECORE_LIB = $_ld_mp3lame
@@ -7663,6 +7692,9 @@
 /* Define if you are using the X.264 library */
 $_def_x264
 
+/* Define if you are using libnut */
+$_def_nut
+
 /* Define to include support for libdv-0.9.5 */
 $_def_libdv
 
Index: libmpdemux/Makefile
===================================================================
--- libmpdemux/Makefile	(revision 19814)
+++ libmpdemux/Makefile	(working copy)
@@ -53,6 +53,9 @@
         demux_y4m.c \
         demux_mkv.c ebml.c \
 
+ifeq ($(LIBNUT),yes)
+SRCS += demux_nut.c
+endif
 ifeq ($(LIBVORBIS),yes)
 SRCS += demux_ogg.c
 endif
Index: libmpdemux/demuxer.c
===================================================================
--- libmpdemux/demuxer.c	(revision 19814)
+++ libmpdemux/demuxer.c	(working copy)
@@ -66,6 +66,7 @@
 extern demuxer_desc_t demuxer_desc_lavf;
 #endif
 extern demuxer_desc_t demuxer_desc_aac;
+extern demuxer_desc_t demuxer_desc_nut;
 
 demuxer_desc_t* demuxer_list[] = {
   &demuxer_desc_rawaudio,
@@ -120,6 +121,9 @@
   &demuxer_desc_rawdv,
 #endif
   &demuxer_desc_aac,
+#ifdef HAVE_LIBNUT
+  &demuxer_desc_nut,
+#endif
 #ifdef HAVE_XMMS
   &demuxer_desc_xmms,
 #endif
Index: libmpdemux/demuxer.h
===================================================================
--- libmpdemux/demuxer.h	(revision 19814)
+++ libmpdemux/demuxer.h	(working copy)
@@ -54,11 +54,12 @@
 #define DEMUXER_TYPE_MPC 40
 #define DEMUXER_TYPE_MPEG_PES 41
 #define DEMUXER_TYPE_MPEG_GXF 42
+#define DEMUXER_TYPE_NUT 43
 
 // This should always match the higest demuxer type number.
 // Unless you want to disallow users to force the demuxer to some types
 #define DEMUXER_TYPE_MIN 0
-#define DEMUXER_TYPE_MAX 42
+#define DEMUXER_TYPE_MAX 43
 
 #define DEMUXER_TYPE_DEMUXERS (1<<16)
 // A virtual demuxer type for the network code
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demux_nut.c
Type: text/x-csrc
Size: 8285 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060915/068291f3/attachment.c>


More information about the MPlayer-dev-eng mailing list