changeset 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 1255d1604e00
children b43e5e6430e6
files libmpcodecs/ve_x264.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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;
 }