summaryrefslogtreecommitdiffstats
path: root/libhb/bd.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2015-11-12 09:31:19 -0800
committerJohn Stebbins <[email protected]>2015-11-12 09:33:49 -0800
commit88ce808b3083415950be070fa7bdc90d49a67eea (patch)
tree77343d055f8056d9e02e094b6c840c31cbbfb0fa /libhb/bd.c
parent6b713adaa58a127a65a5e69a6507d894a4760884 (diff)
bd: fix discontinuity handling
Tag only one buffer with discontinuity flag, not multiple. Flush pre-discontinuity buffers before signaling the discontinuity, not after. Make sure discontinuity flag is on the buffer with the PCR change when possible.
Diffstat (limited to 'libhb/bd.c')
-rw-r--r--libhb/bd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libhb/bd.c b/libhb/bd.c
index 7da108c50..f34eaa1d9 100644
--- a/libhb/bd.c
+++ b/libhb/bd.c
@@ -702,9 +702,9 @@ hb_buffer_t * hb_bd_read( hb_bd_t * d )
uint8_t discontinuity;
int new_chap = 0;
- discontinuity = 0;
while ( 1 )
{
+ discontinuity = 0;
if ( d->next_chap != d->chapter )
{
new_chap = d->chapter = d->next_chap;
@@ -757,6 +757,7 @@ hb_buffer_t * hb_bd_read( hb_bd_t * d )
out = hb_ts_decode_pkt( d->stream, buf+4, new_chap, discontinuity );
if (out != NULL)
return out;
+ new_chap = 0;
}
return NULL;
}