Patent ID: 6901078

Claim:
A method of converting an input data stream having a Program Stream (PS) format into an output data stream having a Transport Stream (TS) format, the method comprising: (a) reading from said input data stream successive blocks of data, said input data stream including data of at least first and second elementary data streams formed and multiplexed in compliance with a PS decoder model; (b) accumulating the data of the first and second elementary streams respectively in first and second queue structures; (c) establishing a TS target decoder model including hypothetical first and second buffers for the first and second elementary streams respectively (d) generating a succession of transport packets to form said output data stream conveying said first and second data streams in said TS format, by reference to said target decoder model; and (e) updating the status of said hypothetical first and second buffers within said TS target decoder in response to each transport packet generated and predetermined properties of said decoder model; wherein each transport packet comprises data from either the first queue, the second queue or neither queue, depending on the scheduling of said elementary streams within the input data stream and on the state of said first and second buffers within said TS target decoder model, and wherein the method includes inhibiting reading of a further data block from said stream when, in the absence of a vacancy for data of said second elementary stream within the target decoder model, a clock reference of said input data stream advances beyond a clock reference of said output data stream by a predetermined waiting threshold.