diff options
author | John Stebbins <[email protected]> | 2015-12-09 13:06:33 -0800 |
---|---|---|
committer | John Stebbins <[email protected]> | 2015-12-09 13:06:33 -0800 |
commit | 3443f6af431934efffdf22ffacc04b7f7ed4b375 (patch) | |
tree | 0ad4b060a475259c47d2fd09f0aae6f829138752 | |
parent | c1d9ab796db9da15e9805ccf826da461a05027fa (diff) |
reader: fix stream discontinuity splicing...
Splicing of buffers that got duplicated to multiple output fifos was
broken.
Caused https://forum.handbrake.fr/viewtopic.php?f=11&t=33666
-rw-r--r-- | libhb/reader.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libhb/reader.c b/libhb/reader.c index 8d32dc31c..009f3ec41 100644 --- a/libhb/reader.c +++ b/libhb/reader.c @@ -331,7 +331,7 @@ static void reader_close( hb_work_object_t * w ) free( r ); } -static void push_buf( hb_work_private_t *r, hb_fifo_t *fifo, hb_buffer_t *buf ) +static hb_buffer_t * splice_discontinuity( hb_work_private_t *r, hb_buffer_t *buf ) { // Handle buffers that were split across a PCR discontinuity. // Rejoin them into a single buffer. @@ -341,7 +341,7 @@ static void push_buf( hb_work_private_t *r, hb_fifo_t *fifo, hb_buffer_t *buf ) hb_buffer_list_append(list, buf); if (buf->s.split) { - return; + return NULL; } int count = hb_buffer_list_count(list); @@ -366,6 +366,11 @@ static void push_buf( hb_work_private_t *r, hb_fifo_t *fifo, hb_buffer_t *buf ) buf = hb_buffer_list_clear(list); } } + return buf; +} + +static void push_buf( hb_work_private_t *r, hb_fifo_t *fifo, hb_buffer_t *buf ) +{ while ( !*r->die && !r->job->done ) { if ( hb_fifo_full_wait( fifo ) ) @@ -770,7 +775,8 @@ static int reader_work( hb_work_object_t * w, hb_buffer_t ** buf_in, } #endif } - if( fifos ) + buf = splice_discontinuity(r, buf); + if( fifos && buf != NULL ) { if ( !r->start_found ) { |