So I didn't get much development work done last night. I did however get Leopard installed on my MacBook, reformatted my old iBook with 10.3 so I could give it to Packy for Parrot development, bisected the v4l-dvb tree to isolate a bug, and watched that really stupid National Treasure movie.
Tonight I got back to working on the ATSC closed captioning. "In our last episode", I had gotten Kaffeine to render the caption data, but the characters were not shown in the correct order. It turns up this is because the characters are arriving in transport order, and they need to be resequenced into picture frame order before they can be announced to the CC decoder (since the render information for a packet is dependent on previous events).
So now I'm going to need some sort of ordered linked list, where I insert packets as they arrive and periodically flush the list into the decoder if the render event with the lowest PTS matches the PTS currently being viewed. I will also have to keep track of when I last flushed the buffer so I don't insert events into the list that have already been rendered in the previous frame.
Oh yeah, and it has to share code with the existing DVD CC rendering, so I have to work within the constraints of the existing code and not break anything.