[xiph-commits] r7377 - in icecast/trunk/ices0: . src

brendan at dactyl.lonelymoon.com brendan
Tue Jul 27 14:00:04 PDT 2004


Author: brendan
Date: Tue Jul 27 14:00:04 2004
New Revision: 7377

Modified:
icecast/trunk/ices0/NEWS
icecast/trunk/ices0/src/reencode.c
Log:
Don't reset the encoder unless we have to. This helps considerably with
the popping between tracks.


Modified: icecast/trunk/ices0/NEWS
===================================================================
--- icecast/trunk/ices0/NEWS	2004-07-27 20:07:06 UTC (rev 7376)
+++ icecast/trunk/ices0/NEWS	2004-07-27 21:00:01 UTC (rev 7377)
@@ -1,3 +1,5 @@
+	* Crossfader added.
+	* Tested with LAME 3.96
0.3     2003-07-13
* Updated to libshout2, which brings icecast2 compatibility.
* ices will now attempt to trim junk and short frames from MP3 files,

Modified: icecast/trunk/ices0/src/reencode.c
===================================================================
--- icecast/trunk/ices0/src/reencode.c	2004-07-27 20:07:06 UTC (rev 7376)
+++ icecast/trunk/ices0/src/reencode.c	2004-07-27 21:00:01 UTC (rev 7377)
@@ -82,9 +82,15 @@
if (! stream->reencode)
continue;

-    if (stream->encoder_state)
-      lame_close ((lame_global_flags*)stream->encoder_state);
+    /* only reset encoder if audio format changes */
+    lame = (lame_global_flags*)stream->encoder_state;
+    if (lame) {
+      if (lame_get_in_samplerate (lame) == source->samplerate)
+	continue;

+      lame_close (lame);
+    }
+
if (! (stream->encoder_state = lame_init ())) {
ices_log ("LAME: error resetting encoder.");
ices_setup_shutdown ();
@@ -159,7 +165,7 @@
lame_global_flags* lame = (lame_global_flags*) stream->encoder_state;
int rc;

-  rc = lame_encode_flush (lame, (char *)outbuf, maxlen);
+  rc = lame_encode_flush_nogap (lame, (char *)outbuf, maxlen);

return rc;
}



More information about the commits mailing list