A quick fix (attached) is to make hb_deinterlace_work clear buf_in->new_chap when it delays frames. A better fix might be to remove the lines in work_loop that copy new_chap from buf_in to buf_out and instead explicitly copy new_chap from buf_in to buf_out in all the video encoder modules (enc{x264,avcodec,xvid}Work). Since encx264Work in particular can also delay frames (when using bidirectional b frames) this would prevent it adding bogus chapter marks if quicktime ever evolves to the point that we're routinely using bidirectional B's.
Code: Select all
Index: libhb/deinterlace.c
===================================================================
--- libhb/deinterlace.c (revision 889)
+++ libhb/deinterlace.c (working copy)
@@ -65,7 +65,7 @@
int height,
char * settings );
-int hb_deinterlace_work( const hb_buffer_t * buf_in,
+int hb_deinterlace_work( hb_buffer_t * buf_in,
hb_buffer_t ** buf_out,
int pix_fmt,
int width,
@@ -497,7 +497,7 @@
free( pv );
}
-int hb_deinterlace_work( const hb_buffer_t * buf_in,
+int hb_deinterlace_work( hb_buffer_t * buf_in,
hb_buffer_t ** buf_out,
int pix_fmt,
int width,
@@ -552,6 +552,9 @@
hb_buffer_copy_settings( pv->buf_settings, buf_in );
+ /* don't let 'work_loop' send a chapter mark upstream */
+ buf_in->new_chap = 0;
+
pv->yadif_ready = 1;
return FILTER_DELAY;
@@ -589,6 +592,9 @@
/* Replace buffered settings with input buffer settings */
hb_buffer_copy_settings( pv->buf_settings, buf_in );
+ /* don't let 'work_loop' send a chapter mark upstream */
+ buf_in->new_chap = 0;
+
return FILTER_OK;
}