* Work *********************************************************************** * **********************************************************************/
| 547 | * |
| 548 | **********************************************************************/ |
| 549 | static int encavcodecaWork( hb_work_object_t * w, hb_buffer_t ** buf_in, |
| 550 | hb_buffer_t ** buf_out ) |
| 551 | { |
| 552 | hb_work_private_t * pv = w->private_data; |
| 553 | hb_buffer_t * in = *buf_in; |
| 554 | hb_buffer_list_t list; |
| 555 | |
| 556 | if (pv->context == NULL || pv->context->codec == NULL) |
| 557 | { |
| 558 | hb_error("encavcodecaudio: codec context is uninitialized"); |
| 559 | return HB_WORK_DONE; |
| 560 | } |
| 561 | |
| 562 | hb_buffer_list_clear(&list); |
| 563 | if (in->s.flags & HB_BUF_FLAG_EOF) |
| 564 | { |
| 565 | /* EOF on input - send it downstream & say we're done */ |
| 566 | Flush(w, &list); |
| 567 | hb_buffer_list_append(&list, hb_buffer_eof_init()); |
| 568 | *buf_out = hb_buffer_list_clear(&list); |
| 569 | return HB_WORK_DONE; |
| 570 | } |
| 571 | |
| 572 | hb_list_add( pv->list, in ); |
| 573 | *buf_in = NULL; |
| 574 | |
| 575 | Encode(w, &list); |
| 576 | *buf_out = hb_buffer_list_clear(&list); |
| 577 | |
| 578 | return HB_WORK_OK; |
| 579 | } |
| 580 | |
| 581 |
nothing calls this directly
no test coverage detected