Optimize MP4 files for HTTP streaming (on the CLI it's -O or --optimize).
[HandBrake.git] / contrib / patch-x264-idr.patch
blobdf4294f12cb23b09271837919283cd0185fe7f78
1 Index: encoder/slicetype.c
2 ===================================================================
3 --- encoder/slicetype.c (revision 665)
4 +++ encoder/slicetype.c (working copy)
5 @@ -379,7 +379,12 @@
6 return;
7 frames[0] = h->frames.last_nonb;
8 for( j = 0; h->frames.next[j]; j++ )
9 + {
10 + // if the app wants an IDR, give it to them
11 + if ( h->frames.next[j]->i_type == X264_TYPE_IDR )
12 + return;
13 frames[j+1] = h->frames.next[j];
14 + }
15 keyint_limit = h->param.i_keyint_max - frames[0]->i_frame + h->frames.i_last_idr - 1;
16 num_frames = X264_MIN( j, keyint_limit );
17 if( num_frames == 0 )