diff options
author | jbrjake <[email protected]> | 2008-06-06 15:35:32 +0000 |
---|---|---|
committer | jbrjake <[email protected]> | 2008-06-06 15:35:32 +0000 |
commit | 72af4736c5c6e097a7cbf769ffd0ff53dd8b58c4 (patch) | |
tree | 101d1ed89cda3af5dc658baf01ea27bb267ead2e | |
parent | d438d1356ef8c99dce95cc3b886085bf91df4a79 (diff) |
Encode the initial H.264 NAL units for PPS and SPS, not just the ones during work. This was a regression caused by r270. Thanks for the patch, j45!
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1498 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/encx264.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libhb/encx264.c b/libhb/encx264.c index 99f4fff41..6c1f347e0 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -74,6 +74,7 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) x264_param_t param; x264_nal_t * nal; int nal_count; + int nal_size; hb_work_private_t * pv = calloc( 1, sizeof( hb_work_private_t ) ); w->private_data = pv; @@ -276,14 +277,12 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) x264_encoder_headers( pv->x264, &nal, &nal_count ); /* Sequence Parameter Set */ - w->config->h264.sps_length = 1 + nal[1].i_payload; - w->config->h264.sps[0] = 0x67; - memcpy( &w->config->h264.sps[1], nal[1].p_payload, nal[1].i_payload ); + x264_nal_encode( w->config->h264.sps, &nal_size, 0, &nal[1] ); + w->config->h264.sps_length = nal_size; /* Picture Parameter Set */ - w->config->h264.pps_length = 1 + nal[2].i_payload; - w->config->h264.pps[0] = 0x68; - memcpy( &w->config->h264.pps[1], nal[2].p_payload, nal[2].i_payload ); + x264_nal_encode( w->config->h264.pps, &nal_size, 0, &nal[2] ); + w->config->h264.pps_length = nal_size; x264_picture_alloc( &pv->pic_in, X264_CSP_I420, job->width, job->height ); |