[SCM] idjc packaging branch, master, updated. debian/0.8.2-3-5-g904b203

alessio at users.alioth.debian.org alessio at users.alioth.debian.org
Thu Jul 1 11:00:31 UTC 2010


The following commit has been merged in the master branch:
commit f049391f4174fc34b022e713deace18141cb83da
Author: Alessio Treglia <alessio at debian.org>
Date:   Thu Jul 1 12:59:13 2010 +0200

    Add patch provided by Peter Green (Closes: #482509) to build against libtwolame properly in order to provide MP2 support.

diff --git a/debian/patches/idjc-twolame.patch b/debian/patches/idjc-twolame.patch
new file mode 100644
index 0000000..4e66c4d
--- /dev/null
+++ b/debian/patches/idjc-twolame.patch
@@ -0,0 +1,186 @@
+Origin: Debian, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482509#25
+Author: Peter Green <plugwash at p10link.net>
+Description: Build with twolame to provide MP2 encoding.
+Bug-Debian: http://bugs.debian.org/482509
+Forwarded: no
+---
+ c/live_mp3_encoder.c |   31 +++++++++++++++++--------------
+ c/live_mp3_encoder.h |    4 ++--
+ configure            |   27 ++++++++++++++-------------
+ configure.in         |    4 ++--
+ 4 files changed, 35 insertions(+), 31 deletions(-)
+
+--- idjc.orig/c/live_mp3_encoder.c
++++ idjc/c/live_mp3_encoder.c
+@@ -123,24 +123,26 @@ static void live_mp3_encoder_main(struct
+          fprintf(stderr, "live_mp3_encoder_main: malloc failure\n");
+          goto bailout;
+          }
+-      if (!(s->gfp = lame_init()))
++      if (!(s->gfp = twolame_init()))
+          {
+          fprintf(stderr, "live_mp3_encoder_main: failed to initialise LAME\n");
+          free(s->mp3buf);
+          goto bailout;
+          }
+-      lame_set_num_channels(s->gfp, encoder->n_channels);
+-      lame_set_brate(s->gfp, encoder->bitrate);
+-      lame_set_in_samplerate(s->gfp, encoder->target_samplerate);
+-      lame_set_out_samplerate(s->gfp, encoder->target_samplerate);
+-      lame_set_mode(s->gfp, s->lame_mode);
+-      lame_set_quality(s->gfp, s->lame_quality);
+-      lame_set_free_format(s->gfp, s->lame_freeformat);
+-      lame_set_bWriteVbrTag(s->gfp, 0);
+-      if (lame_init_params(s->gfp) < 0)
++      twolame_set_num_channels(s->gfp, encoder->n_channels);
++      twolame_set_brate(s->gfp, encoder->bitrate);
++      twolame_set_in_samplerate(s->gfp, encoder->target_samplerate);
++      twolame_set_out_samplerate(s->gfp, encoder->target_samplerate);
++      twolame_set_mode(s->gfp, s->lame_mode);
++      //some settings that lame has but toolame doesn't
++      //don't look too important
++      //twolame_set_quality(s->gfp, s->lame_quality);
++      //twolame_set_free_format(s->gfp, s->lame_freeformat);
++      //twolame_set_bWriteVbrTag(s->gfp, 0);
++      if (twolame_init_params(s->gfp) < 0)
+          {
+          fprintf(stderr, "live_mp3_encoder_main: LAME rejected the parameters given\n");
+-         lame_close(s->gfp);
++         twolame_close(s->gfp);
+          free(s->mp3buf);
+          goto bailout;
+          }
+@@ -161,7 +163,8 @@ static void live_mp3_encoder_main(struct
+       if (encoder->flush || !encoder->run_request_f)
+          {
+          encoder->flush = FALSE;
+-         mp3bytes = lame_encode_flush_nogap(s->gfp, s->mp3buf, s->mp3bufsize);
++         //twolame seems to lack a _flush_nogap, hopefully _flush will do
++         mp3bytes = twolame_encode_flush(s->gfp, s->mp3buf, s->mp3bufsize);
+          fprintf(stderr, "live_mp3_encoder_main: flushing %d bytes\n", mp3bytes);
+          live_mp3_write_packet(encoder, s, s->mp3buf, mp3bytes, PF_MP3 | PF_FINAL);
+          encoder->encoder_state = ES_STOPPING;
+@@ -179,7 +182,7 @@ static void live_mp3_encoder_main(struct
+                   *l++ *= 32768.0F;
+                   *r++ *= 32768.0F;
+                   }
+-            mp3bytes = lame_encode_buffer_float(s->gfp, id->buffer[0], id->buffer[1], id->qty_samples, s->mp3buf, s->mp3bufsize);
++            mp3bytes = twolame_encode_buffer_float32(s->gfp, id->buffer[0], id->buffer[1], id->qty_samples, s->mp3buf, s->mp3bufsize);
+             encoder_ip_data_free(id);
+             s->lame_samples += id->qty_samples;
+             live_mp3_write_packet(encoder, s, s->mp3buf, mp3bytes, PF_MP3 | s->packetflags);
+@@ -197,7 +200,7 @@ static void live_mp3_encoder_main(struct
+       }
+    if (encoder->encoder_state == ES_STOPPING)
+       {
+-      lame_close(s->gfp);
++      twolame_close(s->gfp);
+       free(s->mp3buf);
+       if (encoder->run_request_f)
+          {
+--- idjc.orig/c/live_mp3_encoder.h
++++ idjc/c/live_mp3_encoder.h
+@@ -22,13 +22,13 @@
+ #ifdef DYN_LAME
+ #include "lame.h"
+ #else
+-#include <lame/lame.h>
++#include <twolame.h>
+ #endif /* DYN_LAME */
+ #include "sourceclient.h"
+ 
+ struct lme_data
+    {
+-   lame_global_flags *gfp;
++   twolame_options *gfp;
+    int lame_mode;
+    int lame_channels;
+    int lame_quality;
+--- idjc.orig/configure
++++ idjc/configure
+@@ -5511,13 +5511,13 @@ fi
+ 
+ 
+ if test $makelame != "no" ; then
+-{ $as_echo "$as_me:$LINENO: checking for lame_init in -lmp3lame -lm" >&5
+-$as_echo_n "checking for lame_init in -lmp3lame -lm... " >&6; }
+-if test "${ac_cv_lib_mp3lame__lm_lame_init+set}" = set; then
++{ $as_echo "$as_me:$LINENO: checking for twolame_init in -ltwolame -lm" >&5
++$as_echo_n "checking for twolame_init in -ltwolame -lm... " >&6; }
++if test "${ac_cv_lib_twolame__lm_twolame_init+set}" = set; then
+   $as_echo_n "(cached) " >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lmp3lame -lm  $LIBS"
++LIBS="-ltwolame -lm  $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+@@ -5531,11 +5531,11 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char lame_init ();
++char twolame_init ();
+ int
+ main ()
+ {
+-return lame_init ();
++return twolame_init ();
+   ;
+   return 0;
+ }
+@@ -5561,12 +5561,12 @@ $as_echo "$ac_try_echo") >&5
+ 	 test "$cross_compiling" = yes ||
+ 	 $as_test_x conftest$ac_exeext
+        }; then
+-  ac_cv_lib_mp3lame__lm_lame_init=yes
++  ac_cv_lib_twolame__lm_twolame_init=yes
+ else
+   $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+-	ac_cv_lib_mp3lame__lm_lame_init=no
++	ac_cv_lib_twolame__lm_twolame_init=no
+ fi
+ 
+ rm -rf conftest.dSYM
+@@ -5574,10 +5574,10 @@ rm -f core conftest.err conftest.$ac_obj
+       conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mp3lame__lm_lame_init" >&5
+-$as_echo "$ac_cv_lib_mp3lame__lm_lame_init" >&6; }
+-if test "x$ac_cv_lib_mp3lame__lm_lame_init" = x""yes; then
+-  LIBMP3LAME=-lmp3lame
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_twolame__lm_twolame_init" >&5
++$as_echo "$ac_cv_lib_twolame__lm_twolame_init" >&6; }
++if test "x$ac_cv_lib_twolame__lm_twolame_init" = x""yes; then
++  LIBMP3LAME=-ltwolame
+ 
+ else
+ 
+@@ -8570,7 +8570,8 @@ $debug ||
+ if test -n "$CONFIG_FILES"; then
+ 
+ 
+-ac_cr='
+'
++ac_cr='
++'
+ ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+ if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+   ac_cs_awk_cr='\\r'
+--- idjc.orig/configure.in
++++ idjc/configure.in
+@@ -146,8 +146,8 @@ AC_ARG_ENABLE(lame,
+    AC_HELP_STRING([--disable-lame],[remove capability to stream/record mp3 format]),[makelame=$enableval],[makelame="maybe"])
+ 
+ if test $makelame != "no" ; then
+-AC_CHECK_LIB([mp3lame -lm], [lame_init],
+-	  AC_SUBST(LIBMP3LAME, [-lmp3lame]),
++AC_CHECK_LIB([twolame -lm], [twolame_init],
++	  AC_SUBST(LIBMP3LAME, [-ltwolame]),
+           AC_DEFINE(DYN_LAME, 1, [LAME to be linked dynamically])
+           DYNAMIC="1"
+           if test $makelame = "yes" ; then
diff --git a/debian/patches/series b/debian/patches/series
index b3d8536..32419ae 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ idjc_script.patch
 server_window_size.patch
 idjcmixer_sigsegv.patch
 fix-bashism-in-configure.patch
+idjc-twolame.patch

-- 
idjc packaging



More information about the pkg-multimedia-commits mailing list