Index: mppenc/trunk/encode_sv7.c
===================================================================
--- mppenc/trunk/encode_sv7.c	(revision 34)
+++ mppenc/trunk/encode_sv7.c	(revision 39)
@@ -93,5 +93,6 @@
     WriteBits ( 1            ,  1 );    // true gapless: used?
     WriteBits ( SamplesRest  , 11 );    // true gapless: valid samples in last frame
-    WriteBits ( 0            , 20 );
+    WriteBits ( 1            , 1 );		// we now support fast seeking
+    WriteBits ( 0            , 19 );
 
     WriteBits ( (MPPENC_VERSION[0]&15)*100 + (MPPENC_VERSION[2]&15)*10 + (MPPENC_VERSION[3]&15),
@@ -109,5 +110,5 @@
 #define ENCODE_SCF1( new, old, rll )                         \
         d = new - old + 7;                                   \
-        if ( d <= 14u  &&  (rll < 32  || (int)new < 0 ) ) {  \
+        if ( d <= 14u  && rll < 32) {                        \
             WriteBits ( Table[d].Code, Table[d].Length );    \
         }                                                    \
@@ -242,5 +243,5 @@
             case 2:
                 ENCODE_SCF1 ( SCF_Index_L[n][0], SCF_Last_L[n]    , DSCF_RLL_L[n] );
-                ENCODE_SCFn ( SCF_Index_L[n][2], SCF_Index_L[n][1], DSCF_RLL_L[n] );
+                ENCODE_SCFn ( SCF_Index_L[n][2], SCF_Index_L[n][0], DSCF_RLL_L[n] );
                 SCF_Last_L[n] = SCF_Index_L[n][2];
                 break;
@@ -251,5 +252,6 @@
             }
         }
-        DSCF_RLL_L[n]++;        // Increased counters for SCF that haven't been initialized again
+        if (DSCF_RLL_L[n] <= 32)
+            DSCF_RLL_L[n]++;        // Increased counters for SCF that haven't been initialized again
 
         if ( Res_R[n] ) {
@@ -268,5 +270,5 @@
             case 2:
                 ENCODE_SCF1 ( SCF_Index_R[n][0], SCF_Last_R[n]    , DSCF_RLL_R[n] );
-                ENCODE_SCFn ( SCF_Index_R[n][2], SCF_Index_R[n][1], DSCF_RLL_R[n] );
+                ENCODE_SCFn ( SCF_Index_R[n][2], SCF_Index_R[n][0], DSCF_RLL_R[n] );
                 SCF_Last_R[n] = SCF_Index_R[n][2];
                 break;
@@ -277,5 +279,6 @@
             }
         }
-        DSCF_RLL_R[n]++;          // Increased counters for SCF that haven't been freshly initialized
+        if (DSCF_RLL_R[n] <= 32)
+            DSCF_RLL_R[n]++;          // Increased counters for SCF that haven't been freshly initialized
     }
 
