mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
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:
parent
77f02c2d7e
commit
9e7b890a22
1 changed files with 9 additions and 0 deletions
|
@ -1084,7 +1084,16 @@ gst_flv_demux_parse_tag_video (GstFlvDemux * demux, GstBuffer * buffer)
|
||||||
if (codec_tag == 4 || codec_tag == 5) {
|
if (codec_tag == 4 || codec_tag == 5) {
|
||||||
codec_data = 2;
|
codec_data = 2;
|
||||||
} else if (codec_tag == 7) {
|
} else if (codec_tag == 7) {
|
||||||
|
gint32 cts;
|
||||||
|
|
||||||
codec_data = 5;
|
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) "
|
GST_LOG_OBJECT (demux, "video tag with codec tag %u, keyframe (%d) "
|
||||||
|
|
Loading…
Reference in a new issue