| 1751 | } |
| 1752 | |
| 1753 | static void Synchronize( sync_stream_t * stream ) |
| 1754 | { |
| 1755 | sync_common_t * common = stream->common; |
| 1756 | |
| 1757 | // Sync deposits output directly into fifos, so work_loop is not |
| 1758 | // blocking when output fifos become full. Wait here before |
| 1759 | // performing any output when the output fifo for the input stream |
| 1760 | // is full |
| 1761 | if (stream->fifo_out != NULL && common->start_found) |
| 1762 | { |
| 1763 | while (!common->job->done && !*common->job->die) |
| 1764 | { |
| 1765 | if (hb_fifo_full_wait(stream->fifo_out)) |
| 1766 | { |
| 1767 | break; |
| 1768 | } |
| 1769 | } |
| 1770 | } |
| 1771 | |
| 1772 | hb_lock(common->mutex); |
| 1773 | |
| 1774 | if (!fillQueues(common)) |
| 1775 | { |
| 1776 | hb_unlock(common->mutex); |
| 1777 | return; |
| 1778 | } |
| 1779 | if (!common->found_first_pts) |
| 1780 | { |
| 1781 | checkFirstPts(common); |
| 1782 | } |
| 1783 | OutputBuffer(common); |
| 1784 | |
| 1785 | hb_unlock(common->mutex); |
| 1786 | } |
| 1787 | |
| 1788 | static void updateDuration( sync_stream_t * stream ) |
| 1789 | { |
no test coverage detected