summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
Diffstat (limited to 'libhb')
-rw-r--r--libhb/bd.c5
-rw-r--r--libhb/demuxmpeg.c8
-rw-r--r--libhb/internal.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/libhb/bd.c b/libhb/bd.c
index 47dfe7df8..6ef53361e 100644
--- a/libhb/bd.c
+++ b/libhb/bd.c
@@ -471,6 +471,7 @@ int hb_bd_read( hb_bd_t * d, hb_buffer_t * b )
BD_EVENT event;
uint64_t pos;
+ b->discontinuity = 0;
while ( 1 )
{
if ( d->next_chap != d->chapter )
@@ -507,6 +508,10 @@ int hb_bd_read( hb_bd_t * d, hb_buffer_t * b )
d->next_chap = event.param;
break;
+ case BD_EVENT_PLAYITEM:
+ b->discontinuity = 1;
+ break;
+
default:
break;
}
diff --git a/libhb/demuxmpeg.c b/libhb/demuxmpeg.c
index 4185cb503..763f3e31a 100644
--- a/libhb/demuxmpeg.c
+++ b/libhb/demuxmpeg.c
@@ -218,6 +218,14 @@ int hb_demux_ts( hb_buffer_t *buf_ps, hb_list_t *list_es, hb_psdemux_t *state )
{
if ( state )
{
+ if ( buf_ps->discontinuity )
+ {
+ // Buffer has been flagged as a discontinuity. This happens
+ // when a blueray changes clips.
+ ++state->scr_changes;
+ state->last_scr = buf_ps->start;
+ }
+
// we're keeping track of timing (i.e., not in scan)
// check if there's a new pcr in this packet
if ( buf_ps->stop >= 0 )
diff --git a/libhb/internal.h b/libhb/internal.h
index 092a7d067..5d71cdadf 100644
--- a/libhb/internal.h
+++ b/libhb/internal.h
@@ -69,6 +69,7 @@ struct hb_buffer_s
int id; // ID of the track that the packet comes from
int64_t start; // Video and subtitle packets: start time of frame/subtitle
int64_t stop; // Video and subtitle packets: stop time of frame/subtitle
+ uint8_t discontinuity;
int new_chap; // Video packets: if non-zero, is the index of the chapter whose boundary was crossed
#define HB_FRAME_IDR 0x01