mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
mpegtsdemux: Fix for compiling without GST_DEBUG
Protect debug-only variables/usage, and in one case remove a useless variable.
This commit is contained in:
parent
e66d543f00
commit
79e63e3daf
3 changed files with 17 additions and 2 deletions
|
@ -37,14 +37,20 @@ GST_DEBUG_CATEGORY (gstmpegtsdesc_debug);
|
|||
static guint
|
||||
gst_mpeg_descriptor_parse_1 (guint8 * data, guint size)
|
||||
{
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
guint8 tag;
|
||||
#endif
|
||||
guint8 length;
|
||||
|
||||
/* need at least 2 bytes for tag and length */
|
||||
if (size < 2)
|
||||
return 0;
|
||||
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
tag = *data++;
|
||||
#else
|
||||
data++;
|
||||
#endif
|
||||
length = *data++;
|
||||
size -= 2;
|
||||
|
||||
|
|
|
@ -2741,7 +2741,9 @@ mpegts_packetizer_push_section (MpegTSPacketizer2 * packetizer,
|
|||
gboolean res = FALSE;
|
||||
MpegTSPacketizerStream *stream;
|
||||
guint8 pointer, table_id;
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
guint16 subtable_extension;
|
||||
#endif
|
||||
guint section_length;
|
||||
guint8 *data, *data_start;
|
||||
|
||||
|
@ -2793,6 +2795,7 @@ mpegts_packetizer_push_section (MpegTSPacketizer2 * packetizer,
|
|||
|
||||
if (packet->payload_unit_start_indicator) {
|
||||
table_id = *data++;
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
/* subtable_extension should be read from 4th and 5th bytes only if
|
||||
* section_syntax_indicator is 1 */
|
||||
if ((data[0] & 0x80) == 0)
|
||||
|
@ -2801,6 +2804,7 @@ mpegts_packetizer_push_section (MpegTSPacketizer2 * packetizer,
|
|||
subtable_extension = GST_READ_UINT16_BE (data + 2);
|
||||
GST_DEBUG ("pid: 0x%04x table_id 0x%02x sub_table_extension %d",
|
||||
packet->pid, table_id, subtable_extension);
|
||||
#endif
|
||||
|
||||
section_length = (GST_READ_UINT16_BE (data) & 0x0FFF) + 3;
|
||||
|
||||
|
@ -3385,7 +3389,9 @@ calculate_skew (MpegTSPCR * pcr, guint64 pcrtime, GstClockTime time)
|
|||
gint64 old;
|
||||
gint pos, i;
|
||||
GstClockTime gstpcrtime, out_time;
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
guint64 slope;
|
||||
#endif
|
||||
|
||||
gstpcrtime = PCRTIME_TO_GSTTIME (pcrtime) + pcr->pcroffset;
|
||||
|
||||
|
@ -3474,10 +3480,12 @@ calculate_skew (MpegTSPCR * pcr, guint64 pcrtime, GstClockTime time)
|
|||
/* measure the diff */
|
||||
delta = ((gint64) recv_diff) - ((gint64) send_diff);
|
||||
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
/* measure the slope, this gives a rought estimate between the sender speed
|
||||
* and the receiver speed. This should be approximately 8, higher values
|
||||
* indicate a burst (especially when the connection starts) */
|
||||
slope = recv_diff > 0 ? (send_diff * 8) / recv_diff : 8;
|
||||
#endif
|
||||
|
||||
GST_DEBUG ("time %" GST_TIME_FORMAT ", base %" GST_TIME_FORMAT ", recv_diff %"
|
||||
GST_TIME_FORMAT ", slope %" G_GUINT64_FORMAT, GST_TIME_ARGS (time),
|
||||
|
|
|
@ -1228,7 +1228,6 @@ static void
|
|||
gst_ts_demux_parse_pes_header (GstTSDemux * demux, TSDemuxStream * stream,
|
||||
guint8 * data, guint32 length, guint64 bufferoffset)
|
||||
{
|
||||
MpegTSBase *base = (MpegTSBase *) demux;
|
||||
PESHeader header;
|
||||
gint offset = 0;
|
||||
PESParsingResult parseres;
|
||||
|
@ -1247,7 +1246,7 @@ gst_ts_demux_parse_pes_header (GstTSDemux * demux, TSDemuxStream * stream,
|
|||
gst_ts_demux_record_dts (demux, stream, header.DTS, bufferoffset);
|
||||
gst_ts_demux_record_pts (demux, stream, header.PTS, bufferoffset);
|
||||
|
||||
GST_DEBUG_OBJECT (base,
|
||||
GST_DEBUG_OBJECT (demux,
|
||||
"stream PTS %" GST_TIME_FORMAT " DTS %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (stream->pts), GST_TIME_ARGS (stream->dts));
|
||||
|
||||
|
@ -1472,7 +1471,9 @@ static GstFlowReturn
|
|||
gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream)
|
||||
{
|
||||
GstFlowReturn res = GST_FLOW_OK;
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
MpegTSBaseStream *bs = (MpegTSBaseStream *) stream;
|
||||
#endif
|
||||
GstBuffer *buffer = NULL;
|
||||
|
||||
GST_DEBUG_OBJECT (stream->pad,
|
||||
|
|
Loading…
Reference in a new issue