[FFmpeg-soc] [soc]: r3582 - mlp/mlpenc.c

ramiro subversion at mplayerhq.hu
Sun Aug 24 17:21:58 CEST 2008


Author: ramiro
Date: Sun Aug 24 17:21:58 2008
New Revision: 3582

Log:
Simplify setting of restart_frame.

Modified:
   mlp/mlpenc.c

Modified: mlp/mlpenc.c
==============================================================================
--- mlp/mlpenc.c	(original)
+++ mlp/mlpenc.c	Sun Aug 24 17:21:58 2008
@@ -1711,13 +1711,9 @@ static int mlp_encode_frame(AVCodecConte
         return -1;
     }
 
-    restart_frame = !(avctx->frame_number % ctx->major_header_interval);
+    restart_frame = !ctx->frame_index;
 
-    if (restart_frame) {
-        avctx->coded_frame->key_frame = 1;
-    } else {
-        avctx->coded_frame->key_frame = 0;
-    }
+    avctx->coded_frame->key_frame = restart_frame;
 
     bytes_written = write_access_unit(ctx, buf, buf_size, restart_frame);
 
@@ -1734,7 +1730,7 @@ input_and_return:
     }
 
     ctx->frame_index = (avctx->frame_number + 1) % ctx->major_header_interval;
-    restart_frame = !((avctx->frame_number + 1) % ctx->major_header_interval);
+    restart_frame = !ctx->frame_index;
 
     if (restart_frame) {
         unsigned int index, subblock;



More information about the FFmpeg-soc mailing list