MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / ProcessSCRDelayQueue

Function ProcessSCRDelayQueue

libhb/sync.c:1814–1855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1812}
1813
1814static void ProcessSCRDelayQueue( sync_common_t * common )
1815{
1816 int ii, jj;
1817
1818 for (ii = 0; ii < common->stream_count; ii++)
1819 {
1820 sync_stream_t * stream = &common->streams[ii];
1821 for (jj = 0; jj < hb_list_count(stream->scr_delay_queue);)
1822 {
1823 hb_buffer_t * buf = hb_list_item(stream->scr_delay_queue, jj);
1824 int hash = buf->s.scr_sequence & SCR_HASH_MASK;
1825 if (buf->s.scr_sequence < 0)
1826 {
1827 // Unset scr_sequence indicates an external stream
1828 // (e.g. SRT subtitle) that is not on the same timebase
1829 // as the source tracks. Do not adjust timestamps for
1830 // scr_offset in this case.
1831 hb_list_rem(stream->scr_delay_queue, buf);
1832 SortedQueueBuffer(stream, buf);
1833 }
1834 else if (buf->s.scr_sequence == common->scr[hash].scr_sequence)
1835 {
1836 if (buf->s.start != AV_NOPTS_VALUE)
1837 {
1838 buf->s.start -= common->scr[hash].scr_offset;
1839 buf->s.start -= stream->pts_slip;
1840 }
1841 if (buf->s.stop != AV_NOPTS_VALUE)
1842 {
1843 buf->s.stop -= common->scr[hash].scr_offset;
1844 buf->s.stop -= stream->pts_slip;
1845 }
1846 hb_list_rem(stream->scr_delay_queue, buf);
1847 SortedQueueBuffer(stream, buf);
1848 }
1849 else
1850 {
1851 jj++;
1852 }
1853 }
1854 }
1855}
1856
1857static const char * getStreamType( sync_stream_t * stream )
1858{

Callers 1

UpdateSCRFunction · 0.85

Calls 4

hb_list_countFunction · 0.85
hb_list_itemFunction · 0.85
hb_list_remFunction · 0.85
SortedQueueBufferFunction · 0.85

Tested by

no test coverage detected