diff options
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/encavcodec.c | 8 | ||||
-rw-r--r-- | libhb/encx264.c | 7 | ||||
-rw-r--r-- | libhb/encx265.c | 3 | ||||
-rw-r--r-- | libhb/muxavformat.c | 4 |
4 files changed, 14 insertions, 8 deletions
diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c index 59d491148..9960a21b4 100644 --- a/libhb/encavcodec.c +++ b/libhb/encavcodec.c @@ -532,12 +532,14 @@ static void get_packets( hb_work_object_t * w, hb_buffer_list_t * list ) out->s.duration = get_frame_duration(pv, frameno); out->s.stop = out->s.stop + out->s.duration; // libav 12 deprecated context->coded_frame, so we can't determine - // the exact frame type any more. Luckily for us, we really don't - // require it. + // the exact frame type any more. So until I can completely + // wire up ffmpeg with AV_PKT_DISPOSABLE_FRAME, all frames + // must be considered to potentially be reference frames + out->s.flags = HB_FLAG_FRAMETYPE_REF; out->s.frametype = 0; if (pkt.flags & AV_PKT_FLAG_KEY) { - out->s.flags = HB_FLAG_FRAMETYPE_REF | HB_FLAG_FRAMETYPE_KEY; + out->s.flags |= HB_FLAG_FRAMETYPE_KEY; hb_chapter_dequeue(pv->chapter_queue, out); } out = process_delay_list(pv, out); diff --git a/libhb/encx264.c b/libhb/encx264.c index ce7879ec7..26645213a 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -701,6 +701,7 @@ static hb_buffer_t *nal_encode( hb_work_object_t *w, x264_picture_t *pic_out, frames we only get the duration of the first which will eventually screw up the muxer & decoder. */ int i; + buf->s.flags &= ~HB_FLAG_FRAMETYPE_REF; for( i = 0; i < i_nal; i++ ) { int size = nal[i].i_payload; @@ -737,11 +738,7 @@ static hb_buffer_t *nal_encode( hb_work_object_t *w, x264_picture_t *pic_out, * Also, since libx264 doesn't tell us when B-frames are * themselves reference frames, figure it out on our own. */ - if (nal[i].i_ref_idc == NAL_PRIORITY_DISPOSABLE) - { - buf->s.flags &= ~HB_FLAG_FRAMETYPE_REF; - } - else + if (nal[i].i_ref_idc != NAL_PRIORITY_DISPOSABLE) { if (buf->s.frametype == HB_FRAME_B) { diff --git a/libhb/encx265.c b/libhb/encx265.c index ec7b7d574..242dc6f1f 100644 --- a/libhb/encx265.c +++ b/libhb/encx265.c @@ -425,16 +425,19 @@ static hb_buffer_t* nal_encode(hb_work_object_t *w, buf->s.frametype = HB_FRAME_IDR; break; case X265_TYPE_P: + buf->s.flags |= HB_FLAG_FRAMETYPE_REF; buf->s.frametype = HB_FRAME_P; break; case X265_TYPE_B: buf->s.frametype = HB_FRAME_B; break; case X265_TYPE_BREF: + buf->s.flags |= HB_FLAG_FRAMETYPE_REF; buf->s.frametype = HB_FRAME_BREF; break; case X265_TYPE_I: default: + buf->s.flags |= HB_FLAG_FRAMETYPE_REF; buf->s.frametype = HB_FRAME_I; break; } diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c index f85336dfe..62a270d5b 100644 --- a/libhb/muxavformat.c +++ b/libhb/muxavformat.c @@ -1197,6 +1197,10 @@ static int avformatMux(hb_mux_object_t *m, hb_mux_data_t *track, hb_buffer_t *bu { pkt.flags |= AV_PKT_FLAG_KEY; } + if (!(buf->s.flags & HB_FLAG_FRAMETYPE_REF)) + { + pkt.flags |= AV_PKT_FLAG_DISPOSABLE; + } } else if (buf->s.frametype & HB_FRAME_MASK_KEY) { |