summaryrefslogtreecommitdiffstats
path: root/libhb/enclame.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/enclame.c')
-rw-r--r--libhb/enclame.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/libhb/enclame.c b/libhb/enclame.c
index 0efe21906..9ba7c5d87 100644
--- a/libhb/enclame.c
+++ b/libhb/enclame.c
@@ -185,7 +185,10 @@ int enclameWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
hb_audio_t * audio = w->audio;
hb_buffer_t * in = *buf_in;
hb_buffer_t * buf;
+ hb_buffer_list_t list;
+ *buf_in = NULL;
+ hb_buffer_list_clear(&list);
if (in->s.flags & HB_BUF_FLAG_EOF)
{
/* EOF on input - send it downstream & say we're done */
@@ -202,35 +205,24 @@ int enclameWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
{
hb_buffer_close( &buf );
}
-
- // Add the flushed data
- *buf_out = buf;
-
+ hb_buffer_list_append(&list, buf);
// Add the eof
- if ( buf )
- {
- buf->next = in;
- }
- else
- {
- *buf_out = in;
- }
+ hb_buffer_list_append(&list, in);
- *buf_in = NULL;
+ *buf_out = hb_buffer_list_clear(&list);
return HB_WORK_DONE;
}
- hb_list_add( pv->list, *buf_in );
- *buf_in = NULL;
-
- *buf_out = buf = Encode( w );
+ hb_list_add(pv->list, in);
- while( buf )
+ buf = Encode( w );
+ while (buf)
{
- buf->next = Encode( w );
- buf = buf->next;
+ hb_buffer_list_append(&list, buf);
+ buf = Encode( w );
}
+ *buf_out = hb_buffer_list_clear(&list);
return HB_WORK_OK;
}