Closed LentilStew closed 3 years ago
@LentilStew if I'm not wrong, this while loop is to send raw compressed AvPackets to the decoder until the multimedia source is no longer able to provide them, at this point response
would be a negative number and you'll have to figure out if the packet is bad or we already reached an EOF situation.
Edit: and yes, the packet can contain a single video frame, or several complete audio frames.
I think you can also see it like this:
# DTS - the order the frames are sent [decoder] - the REAL binary stream
# (i.e. a Bth frame depends on previsous I frame and next P frame to be fully decodable... and so )
5,2,1,3,
# PTS - the order the frames must be presented [played] - the DECODED binary way
# (i.e. the way you want to see the frames)
1,2,3,4,5,6
This example you'll read/decode frames 5 and 2 and only then you will decode the frame 1.
Therefore in order for you to decode the "first frame" (PTS order) you might need to open and decode more other frames/packets only then to decode the nth frame you want.
decode_packet() function in the 0_hello_world.c file what does that while loop do? Can a packet contain more than one frame?