mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
mpegvideoparse: support field encoding for interlaced video
https://bugzilla.gnome.org/show_bug.cgi?id=705144
This commit is contained in:
parent
f604bc4964
commit
e5ebd7d846
1 changed files with 15 additions and 0 deletions
|
@ -540,6 +540,21 @@ gst_mpegv_parse_process_sc (GstMpegvParse * mpvparse,
|
|||
else
|
||||
GST_LOG_OBJECT (mpvparse, "Couldn't parse picture at offset %d",
|
||||
mpvparse->pic_offset);
|
||||
|
||||
/* if terminating packet is a picture, we need to check if it has same TSN as the picture that is being
|
||||
terminated. If it does, we need to keep those together, as these packets are two fields of the same
|
||||
frame */
|
||||
if (packet->type == GST_MPEG_VIDEO_PACKET_PICTURE) {
|
||||
if (info->size - off < 2) { /* we need at least two bytes to read the TSN */
|
||||
ret = FALSE;
|
||||
} else {
|
||||
/* TSN is stored in first 10 bits */
|
||||
int tsn = info->data[off] << 2 | (info->data[off + 1] & 0xC0) >> 6;
|
||||
|
||||
if (tsn == mpvparse->pichdr.tsn) /* prevent termination if TSN is same */
|
||||
ret = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue