flvdemux: parse and use cts

For H264, there is an extra header containing the CTS, which is a timestamp
offset that should be applied to the PTS. Parse this value and use it to adjust
the pts.

Fixes #630088
This commit is contained in:
Wim Taymans 2010-09-23 16:46:31 +02:00
parent 77f02c2d7e
commit 9e7b890a22

View file

@ -1084,7 +1084,16 @@ gst_flv_demux_parse_tag_video (GstFlvDemux * demux, GstBuffer * buffer)
if (codec_tag == 4 || codec_tag == 5) {
codec_data = 2;
} else if (codec_tag == 7) {
gint32 cts;
codec_data = 5;
cts = GST_READ_UINT24_BE (data + 9);
cts = (cts + 0xff800000) ^ 0xff800000;
GST_LOG_OBJECT (demux, "got cts %d", cts);
pts = pts + cts;
}
GST_LOG_OBJECT (demux, "video tag with codec tag %u, keyframe (%d) "