summaryrefslogtreecommitdiffstats
path: root/libhb/encavcodec.c
diff options
context:
space:
mode:
authorTim Walker <[email protected]>2016-09-17 15:45:38 +0200
committerTim Walker <[email protected]>2016-09-17 15:45:38 +0200
commitbe6defbde7de260afc61d969c17a898a0fd28106 (patch)
tree720de878e154dcd7300318583323c49721a9511a /libhb/encavcodec.c
parent2df5fe643ebabf4e03456167475b6ca2bbe13c74 (diff)
libhb: use the new keyframe flag.
Diffstat (limited to 'libhb/encavcodec.c')
-rw-r--r--libhb/encavcodec.c53
1 files changed, 15 insertions, 38 deletions
diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c
index b5cee5c81..b17dd10ed 100644
--- a/libhb/encavcodec.c
+++ b/libhb/encavcodec.c
@@ -443,58 +443,36 @@ static void compute_dts_offset( hb_work_private_t * pv, hb_buffer_t * buf )
static uint8_t convert_pict_type( int pict_type, char pkt_flag_key, uint16_t* sflags )
{
+ uint16_t flags = 0;
uint8_t retval = 0;
- switch ( pict_type )
+ switch (pict_type)
{
- case AV_PICTURE_TYPE_P:
- {
- retval = HB_FRAME_P;
- } break;
-
case AV_PICTURE_TYPE_B:
- {
retval = HB_FRAME_B;
- } break;
+ break;
case AV_PICTURE_TYPE_S:
- {
- retval = HB_FRAME_P;
- } break;
-
+ case AV_PICTURE_TYPE_P:
case AV_PICTURE_TYPE_SP:
- {
retval = HB_FRAME_P;
- } break;
+ break;
+
case AV_PICTURE_TYPE_BI:
case AV_PICTURE_TYPE_SI:
case AV_PICTURE_TYPE_I:
- {
- *sflags |= HB_FRAME_REF;
- if ( pkt_flag_key )
- {
- retval = HB_FRAME_IDR;
- }
- else
- {
- retval = HB_FRAME_I;
- }
- } break;
-
default:
{
- if ( pkt_flag_key )
- {
- //buf->s.flags |= HB_FRAME_REF;
- *sflags |= HB_FRAME_REF;
- retval = HB_FRAME_KEY;
- }
- else
- {
- retval = HB_FRAME_REF;
- }
+ flags |= HB_FLAG_FRAMETYPE_REF;
+ retval = HB_FRAME_I;
} break;
}
+ if (pkt_flag_key)
+ {
+ flags |= HB_FLAG_FRAMETYPE_REF;
+ flags |= HB_FLAG_FRAMETYPE_KEY;
+ }
+ *sflags = flags;
return retval;
}
@@ -639,9 +617,8 @@ int encavcodecWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
buf->s.start = get_frame_start( pv, frameno );
buf->s.duration = get_frame_duration( pv, frameno );
buf->s.stop = buf->s.stop + buf->s.duration;
- buf->s.flags &= ~HB_FRAME_REF;
buf->s.frametype = convert_pict_type( pv->context->coded_frame->pict_type, pkt.flags & AV_PKT_FLAG_KEY, &buf->s.flags );
- if (buf->s.frametype & HB_FRAME_KEY)
+ if (buf->s.flags & HB_FLAG_FRAMETYPE_KEY)
{
hb_chapter_dequeue(pv->chapter_queue, buf);
}