mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
mpegdemux: Fix pointer-differences printout
There is unfortunately no G_*_FORMAT conversion specifier for differences of pointers in glib, and we can't rely either on all platforms being 64bit. So let's just cast the difference to a gint and be done with it.
This commit is contained in:
parent
ea067b66a9
commit
ba460f587a
1 changed files with 27 additions and 31 deletions
|
@ -217,10 +217,9 @@ mpegts_packetizer_parse_adaptation_field_control (MpegTSPacketizer * packetizer,
|
||||||
|
|
||||||
/* skip the adaptation field body for now */
|
/* skip the adaptation field body for now */
|
||||||
if (packet->data + length > packet->data_end) {
|
if (packet->data + length > packet->data_end) {
|
||||||
GST_DEBUG ("PID %d afc length %d overflows the buffer current %"
|
GST_DEBUG ("PID %d afc length %d overflows the buffer current %d max %d",
|
||||||
G_GINT64_FORMAT " max %" G_GINT64_FORMAT, packet->pid, length,
|
packet->pid, length, (gint) (packet->data - packet->data_start),
|
||||||
packet->data - packet->data_start,
|
(gint) (packet->data_end - packet->data_start));
|
||||||
packet->data_end - packet->data_start);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,9 +339,8 @@ mpegts_packetizer_parse_descriptors (MpegTSPacketizer * packetizer,
|
||||||
length = *data++;
|
length = *data++;
|
||||||
|
|
||||||
if (data + length > buffer_end) {
|
if (data + length > buffer_end) {
|
||||||
GST_WARNING ("invalid descriptor length %d now at %" G_GINT64_FORMAT
|
GST_WARNING ("invalid descriptor length %d now at %d max %d", length,
|
||||||
" max %" G_GINT64_FORMAT, length, data - *buffer,
|
(gint) (data - *buffer), (gint) (buffer_end - *buffer));
|
||||||
buffer_end - *buffer);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,8 +355,8 @@ mpegts_packetizer_parse_descriptors (MpegTSPacketizer * packetizer,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data != buffer_end) {
|
if (data != buffer_end) {
|
||||||
GST_WARNING ("descriptors size %" G_GINT64_FORMAT " expected %"
|
GST_WARNING ("descriptors size %d expected %d", (gint) (data - *buffer),
|
||||||
G_GINT64_FORMAT, data - *buffer, buffer_end - *buffer);
|
(gint) (buffer_end - *buffer));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,9 +494,8 @@ mpegts_packetizer_parse_pmt (MpegTSPacketizer * packetizer,
|
||||||
/* check that the buffer is large enough to contain at least
|
/* check that the buffer is large enough to contain at least
|
||||||
* program_info_length bytes + CRC */
|
* program_info_length bytes + CRC */
|
||||||
if (data + program_info_length + 4 > end) {
|
if (data + program_info_length + 4 > end) {
|
||||||
GST_WARNING ("PID %d invalid program info length %d "
|
GST_WARNING ("PID %d invalid program info length %d left %d",
|
||||||
"left %" G_GINT64_FORMAT, section->pid, program_info_length,
|
section->pid, program_info_length, (gint) (end - data));
|
||||||
end - data);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -527,9 +524,8 @@ mpegts_packetizer_parse_pmt (MpegTSPacketizer * packetizer,
|
||||||
data += 2;
|
data += 2;
|
||||||
|
|
||||||
if (data + stream_info_length + 4 > end) {
|
if (data + stream_info_length + 4 > end) {
|
||||||
GST_WARNING ("PID %d invalid stream info length %d "
|
GST_WARNING ("PID %d invalid stream info length %d left %d", section->pid,
|
||||||
"left %" G_GINT64_FORMAT, section->pid, stream_info_length,
|
stream_info_length, (gint) (end - data));
|
||||||
end - data);
|
|
||||||
g_value_unset (&programs);
|
g_value_unset (&programs);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -655,8 +651,8 @@ mpegts_packetizer_parse_nit (MpegTSPacketizer * packetizer,
|
||||||
data += 2;
|
data += 2;
|
||||||
|
|
||||||
if (data + section->section_length != end) {
|
if (data + section->section_length != end) {
|
||||||
GST_WARNING ("PID %d invalid NIT section length %d expected %"
|
GST_WARNING ("PID %d invalid NIT section length %d expected %d",
|
||||||
G_GINT64_FORMAT, section->pid, section->section_length, end - data);
|
section->pid, section->section_length, (gint) (end - data));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1236,8 +1232,8 @@ mpegts_packetizer_parse_nit (MpegTSPacketizer * packetizer,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data != end - 4) {
|
if (data != end - 4) {
|
||||||
GST_WARNING ("PID %d invalid NIT parsed %" G_GINT64_FORMAT " length %d",
|
GST_WARNING ("PID %d invalid NIT parsed %d length %d",
|
||||||
section->pid, data - GST_BUFFER_DATA (section->buffer),
|
section->pid, (gint) (data - GST_BUFFER_DATA (section->buffer)),
|
||||||
GST_BUFFER_SIZE (section->buffer));
|
GST_BUFFER_SIZE (section->buffer));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -1292,8 +1288,8 @@ mpegts_packetizer_parse_sdt (MpegTSPacketizer * packetizer,
|
||||||
data += 2;
|
data += 2;
|
||||||
|
|
||||||
if (data + section->section_length != end) {
|
if (data + section->section_length != end) {
|
||||||
GST_WARNING ("PID %d invalid SDT section length %d expected %"
|
GST_WARNING ("PID %d invalid SDT section length %d expected %d",
|
||||||
G_GINT64_FORMAT, section->pid, section->section_length, end - data);
|
section->pid, section->section_length, (gint) (end - data));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1442,8 +1438,8 @@ mpegts_packetizer_parse_sdt (MpegTSPacketizer * packetizer,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data != end - 4) {
|
if (data != end - 4) {
|
||||||
GST_WARNING ("PID %d invalid SDT parsed %" G_GINT64_FORMAT " length %d",
|
GST_WARNING ("PID %d invalid SDT parsed %d length %d",
|
||||||
section->pid, data - GST_BUFFER_DATA (section->buffer),
|
section->pid, (gint) (data - GST_BUFFER_DATA (section->buffer)),
|
||||||
GST_BUFFER_SIZE (section->buffer));
|
GST_BUFFER_SIZE (section->buffer));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -1499,8 +1495,8 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer,
|
||||||
data += 2;
|
data += 2;
|
||||||
|
|
||||||
if (data + section->section_length != end) {
|
if (data + section->section_length != end) {
|
||||||
GST_WARNING ("PID %d invalid EIT section length %d expected %"
|
GST_WARNING ("PID %d invalid EIT section length %d expected %d",
|
||||||
G_GINT64_FORMAT, section->pid, section->section_length, end - data);
|
section->pid, section->section_length, (gint) (end - data));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1541,8 +1537,8 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer,
|
||||||
while (data < end - 4) {
|
while (data < end - 4) {
|
||||||
/* 12 is the minimum entry size + CRC */
|
/* 12 is the minimum entry size + CRC */
|
||||||
if (end - data < 12 + 4) {
|
if (end - data < 12 + 4) {
|
||||||
GST_WARNING ("PID %d invalid EIT entry length %" G_GINT64_FORMAT,
|
GST_WARNING ("PID %d invalid EIT entry length %d",
|
||||||
section->pid, end - 4 - data);
|
section->pid, (gint) (end - 4 - data));
|
||||||
gst_structure_free (eit);
|
gst_structure_free (eit);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -1902,8 +1898,8 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data != end - 4) {
|
if (data != end - 4) {
|
||||||
GST_WARNING ("PID %d invalid EIT parsed %" G_GINT64_FORMAT " length %d",
|
GST_WARNING ("PID %d invalid EIT parsed %d length %d",
|
||||||
section->pid, data - GST_BUFFER_DATA (section->buffer),
|
section->pid, (gint) (data - GST_BUFFER_DATA (section->buffer)),
|
||||||
GST_BUFFER_SIZE (section->buffer));
|
GST_BUFFER_SIZE (section->buffer));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -2142,8 +2138,8 @@ mpegts_packetizer_push_section (MpegTSPacketizer * packetizer,
|
||||||
mpegts_packetizer_clear_section (packetizer, stream);
|
mpegts_packetizer_clear_section (packetizer, stream);
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG
|
GST_DEBUG
|
||||||
("pusi set and new stream section is %d long and data we have is: %"
|
("pusi set and new stream section is %d long and data we have is: %d",
|
||||||
G_GINT64_FORMAT, section_length, packet->data_end - packet->data);
|
section_length, (gint) (packet->data_end - packet->data));
|
||||||
}
|
}
|
||||||
stream->continuity_counter = packet->continuity_counter;
|
stream->continuity_counter = packet->continuity_counter;
|
||||||
stream->section_length = section_length;
|
stream->section_length = section_length;
|
||||||
|
|
Loading…
Reference in a new issue