diff libmpcodecs/ve_x264.c @ 13658:8c93573e0cdf

Mark I-frames as seekable only if we encode with one reference frame, IDR are always seekable patch send by Loren Merritt
author iive
date Sun, 17 Oct 2004 17:59:38 +0000
parents 17cb9c6a99f6
children b825bd2efe14
line wrap: on
line diff
--- a/libmpcodecs/ve_x264.c	Sun Oct 17 17:23:46 2004 +0000
+++ b/libmpcodecs/ve_x264.c	Sun Oct 17 17:59:38 2004 +0000
@@ -304,7 +304,9 @@
         i_size += x264_nal_encode(mod->mux->buffer + i_size, &i_data, 1, &nal[i]);
     }
     if(i_size>0) {
-        muxer_write_chunk(mod->mux, i_size, (mod->pic.i_type == X264_TYPE_I)?0x10:0);
+        int keyframe = (mod->pic.i_type == X264_TYPE_IDR) ||
+                       (mod->pic.i_type == X264_TYPE_I && frame_ref == 1);
+        muxer_write_chunk(mod->mux, i_size, keyframe?0x10:0);
     }
     return 1;
 }