From: Vincent Penquerc'h Date: Thu, 18 Aug 2011 15:20:57 +0000 (+0100) Subject: ogg: do not use 32 bit modifiers to print serial numbers X-Git-Tag: 1.19.3~511^2~6555^2~632 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7bb1e56336b9d3167213e0f48fa0a25ea4b0ad4;p=platform%2Fupstream%2Fgstreamer.git ogg: do not use 32 bit modifiers to print serial numbers If ints are 64 bits, 32 bits should get promoted in varargs anyway, and we don't care about 16 bit ints. This makes the code a lot more readable, and still gets us nice hexadecimal 32 bit serialnos. https://bugzilla.gnome.org/show_bug.cgi?id=656775 --- diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index eddaa44..ff05c82 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -427,7 +427,7 @@ gst_ogg_demux_queue_data (GstOggPad * pad, ogg_packet * packet) GstOggDemux *ogg = pad->ogg; #endif - GST_DEBUG_OBJECT (ogg, "%p queueing data serial %08" G_GINT32_MODIFIER "x", + GST_DEBUG_OBJECT (ogg, "%p queueing data serial %08x", pad, pad->map.serialno); pad->map.queued = g_list_append (pad->map.queued, _ogg_packet_copy (packet)); @@ -455,8 +455,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet, cret = GST_FLOW_OK; GST_DEBUG_OBJECT (ogg, - "%p streaming to peer serial %08" G_GINT32_MODIFIER "x", pad, - pad->map.serialno); + "%p streaming to peer serial %08x", pad, pad->map.serialno); if (pad->map.is_ogm) { const guint8 *data; @@ -706,7 +705,7 @@ gst_ogg_pad_submit_packet (GstOggPad * pad, ogg_packet * packet) GstOggDemux *ogg = pad->ogg; - GST_DEBUG_OBJECT (ogg, "%p submit packet serial %08" G_GINT32_MODIFIER "x", + GST_DEBUG_OBJECT (ogg, "%p submit packet serial %08x", pad, pad->map.serialno); if (!pad->have_type) { @@ -980,8 +979,8 @@ gst_ogg_pad_stream_out (GstOggPad * pad, gint npackets) could_not_submit: { GST_WARNING_OBJECT (ogg, - "could not submit packet for stream %08" G_GINT32_MODIFIER - "x, error: %d", pad->map.serialno, result); + "could not submit packet for stream %08x, " + "error: %d", pad->map.serialno, result); gst_ogg_pad_reset (pad); return result; } @@ -1073,8 +1072,8 @@ done: choked: { GST_WARNING_OBJECT (ogg, - "ogg stream choked on page (serial %08" G_GINT32_MODIFIER - "x), resetting stream", pad->map.serialno); + "ogg stream choked on page (serial %08x), " + "resetting stream", pad->map.serialno); gst_ogg_pad_reset (pad); /* we continue to recover */ return GST_FLOW_OK; @@ -1154,8 +1153,7 @@ gst_ogg_chain_new_stream (GstOggChain * chain, guint32 serialno) gchar *name; GST_DEBUG_OBJECT (chain->ogg, - "creating new stream %08" G_GINT32_MODIFIER "x in chain %p", serialno, - chain); + "creating new stream %08x in chain %p", serialno, chain); ret = g_object_new (GST_TYPE_OGG_PAD, NULL); /* we own this one */ @@ -1172,7 +1170,7 @@ gst_ogg_chain_new_stream (GstOggChain * chain, guint32 serialno) if (ogg_stream_init (&ret->map.stream, serialno) != 0) goto init_failed; - name = g_strdup_printf ("serial_%08" G_GINT32_MODIFIER "x", serialno); + name = g_strdup_printf ("serial_%08x", serialno); gst_object_set_name (GST_OBJECT (ret), name); g_free (name); @@ -1183,8 +1181,7 @@ gst_ogg_chain_new_stream (GstOggChain * chain, guint32 serialno) gst_tag_list_free (list); GST_DEBUG_OBJECT (chain->ogg, - "created new ogg src %p for stream with serial %08" G_GINT32_MODIFIER "x", - ret, serialno); + "created new ogg src %p for stream with serial %08x", ret, serialno); g_array_append_val (chain->streams, ret); @@ -1193,8 +1190,8 @@ gst_ogg_chain_new_stream (GstOggChain * chain, guint32 serialno) /* ERRORS */ init_failed: { - GST_ERROR ("Could not initialize ogg_stream struct for serial %08" - G_GINT32_MODIFIER "x.", serialno); + GST_ERROR ("Could not initialize ogg_stream struct for serial %08x", + serialno); gst_object_unref (ret); return NULL; } @@ -2169,7 +2166,7 @@ gst_ogg_demux_do_seek (GstOggDemux * ogg, GstSegment * segment, keyframe_time = gst_ogg_stream_granule_to_time (&pad->map, pad->keyframe_granule); GST_LOG_OBJECT (ogg, - "stream %08" G_GINT32_MODIFIER "x granule time %" GST_TIME_FORMAT, + "stream %08x granule time %" GST_TIME_FORMAT, pad->map.serialno, GST_TIME_ARGS (keyframe_time)); /* collect smallest value */ @@ -2683,8 +2680,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain) serial = ogg_page_serialno (&op); if (gst_ogg_chain_get_stream (chain, serial) != NULL) { GST_WARNING_OBJECT (ogg, - "found serial %08" G_GINT32_MODIFIER "x BOS page twice, ignoring", - serial); + "found serial %08x BOS page twice, ignoring", serial); continue; } @@ -2734,7 +2730,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain) GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i); GST_LOG_OBJECT (ogg, - "serial %08" G_GINT32_MODIFIER "x time %" GST_TIME_FORMAT, + "serial %08x time %" GST_TIME_FORMAT, pad->map.serialno, GST_TIME_ARGS (pad->start_time)); if (pad->map.serialno == serial) { @@ -2758,15 +2754,14 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain) if (!pad->map.is_sparse) done &= (pad->start_time != GST_CLOCK_TIME_NONE); - GST_LOG_OBJECT (ogg, "done %08" G_GINT32_MODIFIER "x now %d", - pad->map.serialno, done); + GST_LOG_OBJECT (ogg, "done %08x now %d", pad->map.serialno, done); } /* we read a page not belonging to the current chain: seek back to the * beginning of the chain */ if (!known_serial) { - GST_LOG_OBJECT (ogg, "unknown serial %08" G_GINT32_MODIFIER "x", serial); + GST_LOG_OBJECT (ogg, "unknown serial %08x", serial); gst_ogg_demux_seek (ogg, offset); break; } @@ -3060,8 +3055,8 @@ gst_ogg_demux_handle_page (GstOggDemux * ogg, ogg_page * page) granule = ogg_page_granulepos (page); GST_LOG_OBJECT (ogg, - "processing ogg page (serial %08" G_GINT32_MODIFIER - "x, pageno %ld, granulepos %" G_GINT64_FORMAT ", bos %d)", serialno, + "processing ogg page (serial %08x, " + "pageno %ld, granulepos %" G_GINT64_FORMAT ", bos %d)", serialno, ogg_page_pageno (page), granule, ogg_page_bos (page)); if (ogg_page_bos (page)) { @@ -3129,9 +3124,7 @@ gst_ogg_demux_handle_page (GstOggDemux * ogg, ogg_page * page) /* no pad. This means an ogg page without bos has been seen for this * serialno. we just ignore it but post a warning... */ GST_ELEMENT_WARNING (ogg, STREAM, DECODE, - (NULL), - ("unknown ogg pad for serial %08" G_GINT32_MODIFIER "x detected", - serialno)); + (NULL), ("unknown ogg pad for serial %08x detected", serialno)); return GST_FLOW_OK; } return result; @@ -3140,9 +3133,7 @@ gst_ogg_demux_handle_page (GstOggDemux * ogg, ogg_page * page) unknown_chain: { GST_ELEMENT_ERROR (ogg, STREAM, DECODE, - (NULL), - ("unknown ogg chain for serial %08" G_GINT32_MODIFIER "x detected", - serialno)); + (NULL), ("unknown ogg chain for serial %08x detected", serialno)); return GST_FLOW_ERROR; } } @@ -3685,8 +3676,7 @@ gst_ogg_print (GstOggDemux * ogg) for (j = 0; j < chain->streams->len; j++) { GstOggPad *stream = g_array_index (chain->streams, GstOggPad *, j); - GST_INFO_OBJECT (ogg, " stream %08" G_GINT32_MODIFIER "x:", - stream->map.serialno); + GST_INFO_OBJECT (ogg, " stream %08x:", stream->map.serialno); GST_INFO_OBJECT (ogg, " start time: %" GST_TIME_FORMAT, GST_TIME_ARGS (stream->start_time)); } diff --git a/ext/ogg/gstoggparse.c b/ext/ogg/gstoggparse.c index eae0acd..4d9c771 100644 --- a/ext/ogg/gstoggparse.c +++ b/ext/ogg/gstoggparse.c @@ -466,7 +466,7 @@ gst_ogg_parse_chain (GstPad * pad, GstBuffer * buffer) GstOggStream *stream = gst_ogg_parse_find_stream (ogg, serialno); if (stream != NULL) { - GST_LOG_OBJECT (ogg, "Incorrect stream; repeats serial number %u " + GST_LOG_OBJECT (ogg, "Incorrect stream; repeats serial number %08x " "at offset %" G_GINT64_FORMAT, serialno, ogg->offset); } @@ -560,7 +560,7 @@ gst_ogg_parse_chain (GstPad * pad, GstBuffer * buffer) GstOggStream *stream = (GstOggStream *) l->data; if (g_list_length (stream->headers) == 0) { - GST_LOG_OBJECT (ogg, "No primary header found for stream %08lx", + GST_LOG_OBJECT (ogg, "No primary header found for stream %08x", stream->serialno); goto failure; }