Commit dc25b29d authored by Jean-Paul Saman's avatar Jean-Paul Saman

codec/x264.c: workaround for "late buffer for mux input" error

With this code changes the dice rolls favorable for vlc and transcoding
a 13 MiB/s stream results in smooth playback and streaming. This is a
workaround that happens to now, but is probably not going to work in another
situation.
parent 39cd3674
...@@ -1296,7 +1296,22 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict ) ...@@ -1296,7 +1296,22 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict )
#if X264_BUILD >= 98 #if X264_BUILD >= 98
x264_picture_init( &pic ); x264_picture_init( &pic );
#else #else
memset( &pic, 0, sizeof( x264_picture_t ) ); //memset( &pic, 0, sizeof( x264_picture_t ) );
#if 0
pic.i_type = 0;
pic.i_qpplus1 = 0;
pic.b_keyframe = 0;
pic.img.i_csp = 0;
pic.img.i_plane = 0;
for( i=0; i<4; i++) {
pic.img.i_stride[i] = 0;
pic.img.plane[i] = NULL;
}
#else
pic.i_dts = pic.i_pts = 0;
pic.param = NULL;
pic.opaque = NULL;
#endif
#endif #endif
if( likely(p_pict) ) { if( likely(p_pict) ) {
pic.i_pts = p_pict->date; pic.i_pts = p_pict->date;
...@@ -1316,6 +1331,9 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict ) ...@@ -1316,6 +1331,9 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict )
x264_encoder_encode( p_sys->h, &nal, &i_nal, &pic, &pic ); x264_encoder_encode( p_sys->h, &nal, &i_nal, &pic, &pic );
} else { } else {
#if X264_BUILD < 98
memset( &pic, 0, sizeof( x264_picture_t ) );
#endif
if( x264_encoder_delayed_frames( p_sys->h ) ) { if( x264_encoder_delayed_frames( p_sys->h ) ) {
x264_encoder_encode( p_sys->h, &nal, &i_nal, NULL, &pic ); x264_encoder_encode( p_sys->h, &nal, &i_nal, NULL, &pic );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment