mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 06:16:36 +00:00
mpegtsbase: Adapt to new packetizer behaviour
This commit is contained in:
parent
c6035d403c
commit
3c73d29162
1 changed files with 6 additions and 14 deletions
|
@ -1060,15 +1060,11 @@ mpegts_base_handle_psi (MpegTSBase * base, MpegTSPacketizerSection * section)
|
||||||
|
|
||||||
/* table ids 0x70 - 0x73 do not have a crc */
|
/* table ids 0x70 - 0x73 do not have a crc */
|
||||||
if (G_LIKELY (section->table_id < 0x70 || section->table_id > 0x73)) {
|
if (G_LIKELY (section->table_id < 0x70 || section->table_id > 0x73)) {
|
||||||
GstMapInfo map;
|
if (G_UNLIKELY (mpegts_base_calc_crc32 (section->data,
|
||||||
|
section->section_length) != 0)) {
|
||||||
gst_buffer_map (section->buffer, &map, GST_MAP_READ);
|
|
||||||
if (G_UNLIKELY (mpegts_base_calc_crc32 (map.data, map.size) != 0)) {
|
|
||||||
gst_buffer_unmap (section->buffer, &map);
|
|
||||||
GST_WARNING_OBJECT (base, "bad crc in psi pid 0x%x", section->pid);
|
GST_WARNING_OBJECT (base, "bad crc in psi pid 0x%x", section->pid);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
gst_buffer_unmap (section->buffer, &map);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (section->table_id) {
|
switch (section->table_id) {
|
||||||
|
@ -1079,10 +1075,9 @@ mpegts_base_handle_psi (MpegTSBase * base, MpegTSPacketizerSection * section)
|
||||||
mpegts_base_apply_pat (base, structure);
|
mpegts_base_apply_pat (base, structure);
|
||||||
if (base->seen_pat == FALSE) {
|
if (base->seen_pat == FALSE) {
|
||||||
base->seen_pat = TRUE;
|
base->seen_pat = TRUE;
|
||||||
GST_DEBUG ("First PAT offset: %" G_GUINT64_FORMAT,
|
GST_DEBUG ("First PAT offset: %" G_GUINT64_FORMAT, section->offset);
|
||||||
GST_BUFFER_OFFSET (section->buffer));
|
|
||||||
mpegts_packetizer_set_reference_offset (base->packetizer,
|
mpegts_packetizer_set_reference_offset (base->packetizer,
|
||||||
GST_BUFFER_OFFSET (section->buffer));
|
section->offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else
|
} else
|
||||||
|
@ -1388,7 +1383,6 @@ mpegts_base_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||||
if (G_UNLIKELY (pret == PACKET_BAD)) {
|
if (G_UNLIKELY (pret == PACKET_BAD)) {
|
||||||
/* bad header, skip the packet */
|
/* bad header, skip the packet */
|
||||||
GST_DEBUG_OBJECT (base, "bad packet, skipping");
|
GST_DEBUG_OBJECT (base, "bad packet, skipping");
|
||||||
gst_buffer_unref (packet.buffer);
|
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1403,10 +1397,9 @@ mpegts_base_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||||
if (G_LIKELY (section.complete)) {
|
if (G_LIKELY (section.complete)) {
|
||||||
/* section complete */
|
/* section complete */
|
||||||
based = mpegts_base_handle_psi (base, §ion);
|
based = mpegts_base_handle_psi (base, §ion);
|
||||||
gst_buffer_unref (section.buffer);
|
g_free (section.data);
|
||||||
|
|
||||||
if (G_UNLIKELY (!based)) {
|
if (G_UNLIKELY (!based)) {
|
||||||
gst_buffer_unref (packet.buffer);
|
|
||||||
/* bad PSI table */
|
/* bad PSI table */
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
@ -1417,8 +1410,7 @@ mpegts_base_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||||
} else if (MPEGTS_BIT_IS_SET (base->is_pes, packet.pid)) {
|
} else if (MPEGTS_BIT_IS_SET (base->is_pes, packet.pid)) {
|
||||||
/* push the packet downstream */
|
/* push the packet downstream */
|
||||||
res = mpegts_base_push (base, &packet, NULL);
|
res = mpegts_base_push (base, &packet, NULL);
|
||||||
} else
|
}
|
||||||
gst_buffer_unref (packet.buffer);
|
|
||||||
|
|
||||||
next:
|
next:
|
||||||
mpegts_packetizer_clear_packet (base->packetizer, &packet);
|
mpegts_packetizer_clear_packet (base->packetizer, &packet);
|
||||||
|
|
Loading…
Reference in a new issue