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:
Edward Hervey 2009-11-04 17:13:34 +01:00
parent ea067b66a9
commit ba460f587a

View file

@ -217,10 +217,9 @@ mpegts_packetizer_parse_adaptation_field_control (MpegTSPacketizer * packetizer,
/* skip the adaptation field body for now */
if (packet->data + length > packet->data_end) {
GST_DEBUG ("PID %d afc length %d overflows the buffer current %"
G_GINT64_FORMAT " max %" G_GINT64_FORMAT, packet->pid, length,
packet->data - packet->data_start,
packet->data_end - packet->data_start);
GST_DEBUG ("PID %d afc length %d overflows the buffer current %d max %d",
packet->pid, length, (gint) (packet->data - packet->data_start),
(gint) (packet->data_end - packet->data_start));
return FALSE;
}
@ -340,9 +339,8 @@ mpegts_packetizer_parse_descriptors (MpegTSPacketizer * packetizer,
length = *data++;
if (data + length > buffer_end) {
GST_WARNING ("invalid descriptor length %d now at %" G_GINT64_FORMAT
" max %" G_GINT64_FORMAT, length, data - *buffer,
buffer_end - *buffer);
GST_WARNING ("invalid descriptor length %d now at %d max %d", length,
(gint) (data - *buffer), (gint) (buffer_end - *buffer));
goto error;
}
@ -357,8 +355,8 @@ mpegts_packetizer_parse_descriptors (MpegTSPacketizer * packetizer,
}
if (data != buffer_end) {
GST_WARNING ("descriptors size %" G_GINT64_FORMAT " expected %"
G_GINT64_FORMAT, data - *buffer, buffer_end - *buffer);
GST_WARNING ("descriptors size %d expected %d", (gint) (data - *buffer),
(gint) (buffer_end - *buffer));
goto error;
}
@ -496,9 +494,8 @@ mpegts_packetizer_parse_pmt (MpegTSPacketizer * packetizer,
/* check that the buffer is large enough to contain at least
* program_info_length bytes + CRC */
if (data + program_info_length + 4 > end) {
GST_WARNING ("PID %d invalid program info length %d "
"left %" G_GINT64_FORMAT, section->pid, program_info_length,
end - data);
GST_WARNING ("PID %d invalid program info length %d left %d",
section->pid, program_info_length, (gint) (end - data));
goto error;
}
@ -527,9 +524,8 @@ mpegts_packetizer_parse_pmt (MpegTSPacketizer * packetizer,
data += 2;
if (data + stream_info_length + 4 > end) {
GST_WARNING ("PID %d invalid stream info length %d "
"left %" G_GINT64_FORMAT, section->pid, stream_info_length,
end - data);
GST_WARNING ("PID %d invalid stream info length %d left %d", section->pid,
stream_info_length, (gint) (end - data));
g_value_unset (&programs);
goto error;
}
@ -655,8 +651,8 @@ mpegts_packetizer_parse_nit (MpegTSPacketizer * packetizer,
data += 2;
if (data + section->section_length != end) {
GST_WARNING ("PID %d invalid NIT section length %d expected %"
G_GINT64_FORMAT, section->pid, section->section_length, end - data);
GST_WARNING ("PID %d invalid NIT section length %d expected %d",
section->pid, section->section_length, (gint) (end - data));
goto error;
}
@ -1236,8 +1232,8 @@ mpegts_packetizer_parse_nit (MpegTSPacketizer * packetizer,
}
if (data != end - 4) {
GST_WARNING ("PID %d invalid NIT parsed %" G_GINT64_FORMAT " length %d",
section->pid, data - GST_BUFFER_DATA (section->buffer),
GST_WARNING ("PID %d invalid NIT parsed %d length %d",
section->pid, (gint) (data - GST_BUFFER_DATA (section->buffer)),
GST_BUFFER_SIZE (section->buffer));
goto error;
}
@ -1292,8 +1288,8 @@ mpegts_packetizer_parse_sdt (MpegTSPacketizer * packetizer,
data += 2;
if (data + section->section_length != end) {
GST_WARNING ("PID %d invalid SDT section length %d expected %"
G_GINT64_FORMAT, section->pid, section->section_length, end - data);
GST_WARNING ("PID %d invalid SDT section length %d expected %d",
section->pid, section->section_length, (gint) (end - data));
goto error;
}
@ -1442,8 +1438,8 @@ mpegts_packetizer_parse_sdt (MpegTSPacketizer * packetizer,
}
if (data != end - 4) {
GST_WARNING ("PID %d invalid SDT parsed %" G_GINT64_FORMAT " length %d",
section->pid, data - GST_BUFFER_DATA (section->buffer),
GST_WARNING ("PID %d invalid SDT parsed %d length %d",
section->pid, (gint) (data - GST_BUFFER_DATA (section->buffer)),
GST_BUFFER_SIZE (section->buffer));
goto error;
}
@ -1499,8 +1495,8 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer,
data += 2;
if (data + section->section_length != end) {
GST_WARNING ("PID %d invalid EIT section length %d expected %"
G_GINT64_FORMAT, section->pid, section->section_length, end - data);
GST_WARNING ("PID %d invalid EIT section length %d expected %d",
section->pid, section->section_length, (gint) (end - data));
goto error;
}
@ -1541,8 +1537,8 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer,
while (data < end - 4) {
/* 12 is the minimum entry size + CRC */
if (end - data < 12 + 4) {
GST_WARNING ("PID %d invalid EIT entry length %" G_GINT64_FORMAT,
section->pid, end - 4 - data);
GST_WARNING ("PID %d invalid EIT entry length %d",
section->pid, (gint) (end - 4 - data));
gst_structure_free (eit);
goto error;
}
@ -1902,8 +1898,8 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer,
}
if (data != end - 4) {
GST_WARNING ("PID %d invalid EIT parsed %" G_GINT64_FORMAT " length %d",
section->pid, data - GST_BUFFER_DATA (section->buffer),
GST_WARNING ("PID %d invalid EIT parsed %d length %d",
section->pid, (gint) (data - GST_BUFFER_DATA (section->buffer)),
GST_BUFFER_SIZE (section->buffer));
goto error;
}
@ -2142,8 +2138,8 @@ mpegts_packetizer_push_section (MpegTSPacketizer * packetizer,
mpegts_packetizer_clear_section (packetizer, stream);
} else {
GST_DEBUG
("pusi set and new stream section is %d long and data we have is: %"
G_GINT64_FORMAT, section_length, packet->data_end - packet->data);
("pusi set and new stream section is %d long and data we have is: %d",
section_length, (gint) (packet->data_end - packet->data));
}
stream->continuity_counter = packet->continuity_counter;
stream->section_length = section_length;