summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkonablend <kona8lend@gmail.com>2009-05-03 21:53:37 +0000
committerkonablend <kona8lend@gmail.com>2009-05-03 21:53:37 +0000
commit1349c26c5417fd23676a4cb5cf572fbfe75e3b62 (patch)
tree2825ce266e5bd4cb4231a66d08fd6ba68ee99f6b
parent79be76e91e82c68f036fbc3f06283fa25a7d5e87 (diff)
- minor code cleanup - use x264_nal_t.i_type instead of buffer+offset&mask.
- use constants instead of hardcoded values. - explicitly list expected nal types to be processed further. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2372 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/encx264.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/libhb/encx264.c b/libhb/encx264.c
index 374c92184..d00479468 100644
--- a/libhb/encx264.c
+++ b/libhb/encx264.c
@@ -448,12 +448,20 @@ static hb_buffer_t *nal_encode( hb_work_object_t *w, x264_picture_t *pic_out,
}
/* H.264 in .mp4 or .mkv */
- int naltype = buf->data[buf->size+4] & 0x1f;
- if ( naltype == 0x7 || naltype == 0x8 )
+ switch( nal[i].i_type )
{
- // Sequence Parameter Set & Program Parameter Set go in the
- // mp4 header so skip them here
- continue;
+ /* Sequence Parameter Set & Program Parameter Set go in the
+ * mp4 header so skip them here
+ */
+ case NAL_SPS:
+ case NAL_PPS:
+ continue;
+
+ case NAL_SLICE:
+ case NAL_SLICE_IDR:
+ case NAL_SEI:
+ default:
+ break;
}
/* H.264 in mp4 (stolen from mp4creator) */