diff options
author | John Stebbins <[email protected]> | 2015-11-15 15:52:58 -0800 |
---|---|---|
committer | John Stebbins <[email protected]> | 2015-11-15 15:52:58 -0800 |
commit | fb871fd8b3b5716f1fc00c9aeacba335a652a526 (patch) | |
tree | bfd52bf3d8e869a1eb4de6463dc880be4bea8e9b /libhb/decsrtsub.c | |
parent | 6ac2175e77baf2dca4803ea7a4792806697ac2b0 (diff) |
decsrt: configure as buffer source
set fifo_in to NULL so hb_work_loop will call repeadedly without the
hack that primes it's input fifo.
Diffstat (limited to 'libhb/decsrtsub.c')
-rw-r--r-- | libhb/decsrtsub.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/libhb/decsrtsub.c b/libhb/decsrtsub.c index 164f7c09f..98c36cf64 100644 --- a/libhb/decsrtsub.c +++ b/libhb/decsrtsub.c @@ -600,7 +600,6 @@ static int decsrtInit( hb_work_object_t * w, hb_job_t * job ) { int retval = 1; hb_work_private_t * pv; - hb_buffer_t *buffer; int i; hb_chapter_t * chapter; @@ -610,10 +609,6 @@ static int decsrtInit( hb_work_object_t * w, hb_job_t * job ) w->private_data = pv; pv->job = job; - - buffer = hb_buffer_init( 0 ); - hb_fifo_push( w->fifo_in, buffer); - pv->current_state = k_state_potential_new_entry; pv->number_of_entries = 0; pv->last_entry_number = 0; @@ -688,26 +683,18 @@ static int decsrtWork( hb_work_object_t * w, hb_buffer_t ** buf_in, hb_buffer_t ** buf_out ) { hb_work_private_t * pv = w->private_data; - hb_buffer_t * in = *buf_in; hb_buffer_t * out = NULL; out = srt_read( pv ); - if( out ) + if (out != NULL) { hb_srt_to_ssa(out, ++pv->line); - - /* - * Keep a buffer in our input fifo so that we get run. - */ - hb_fifo_push( w->fifo_in, in); - *buf_in = NULL; *buf_out = out; - } else { - *buf_out = NULL; return HB_WORK_OK; + } else { + *buf_out = hb_buffer_eof_init(); + return HB_WORK_DONE; } - - return HB_WORK_OK; } static void decsrtClose( hb_work_object_t * w ) |