From aaed93e1265959bb06c4759e68537788c9446681 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Fri, 24 Jul 2009 21:54:59 +0100 Subject: kate: use GST_ELEMENT_ERROR for error reporting See #525743. --- ext/kate/gstkateparse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ext/kate/gstkateparse.c') diff --git a/ext/kate/gstkateparse.c b/ext/kate/gstkateparse.c index 89d17514..e9bcd5ae 100644 --- a/ext/kate/gstkateparse.c +++ b/ext/kate/gstkateparse.c @@ -58,8 +58,6 @@ * */ -/* FIXME: post appropriate GST_ELEMENT_ERROR when returning FLOW_ERROR */ - #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -174,7 +172,8 @@ gst_kate_parse_push_headers (GstKateParse * parse) gst_pad_get_negotiated_caps (parse->sinkpad), parse->streamheader); if (G_UNLIKELY (!caps)) { - GST_ERROR_OBJECT (parse, "Failed to set headers on caps"); + GST_ELEMENT_ERROR (parse, STREAM, DECODE, (NULL), + ("Failed to set headers on caps")); return GST_FLOW_ERROR; } @@ -182,8 +181,8 @@ gst_kate_parse_push_headers (GstKateParse * parse) res = gst_pad_set_caps (parse->srcpad, caps); gst_caps_unref (caps); if (G_UNLIKELY (!res)) { - GST_WARNING_OBJECT (parse, "Failed to set pad caps"); - return GST_FLOW_ERROR; + GST_WARNING_OBJECT (parse->srcpad, "Failed to set caps on source pad"); + return GST_FLOW_NOT_NEGOTIATED; } headers = parse->streamheader; @@ -343,7 +342,8 @@ gst_kate_parse_queue_buffer (GstKateParse * parse, GstBuffer * buf) if (granpos >= 0) { ret = gst_kate_parse_drain_queue (parse, granpos); } else { - GST_WARNING_OBJECT (parse, "granulepos < 0 (%lld)", granpos); + GST_ELEMENT_ERROR (parse, STREAM, DECODE, (NULL), + ("Bad granulepos %" G_GINT64_FORMAT, granpos)); ret = GST_FLOW_ERROR; } #endif -- cgit v1.2.1 From 24217ee31a5030f528e13a94233580e86d70baf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 8 Aug 2009 12:20:55 +0100 Subject: kate: some minor clean-ups Print flow return as string in log message; if we check the return value of gst_buffer_new_and_alloc() we should use the _try() function that might actually return NULL. Post error message when returning GST_FLOW_ERROR. Use portable GLib macros to print 64-bit integers. Don't use 0LL, that's also not portable (and unneeded here). --- ext/kate/gstkateparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/kate/gstkateparse.c') diff --git a/ext/kate/gstkateparse.c b/ext/kate/gstkateparse.c index e9bcd5ae..e4a83477 100644 --- a/ext/kate/gstkateparse.c +++ b/ext/kate/gstkateparse.c @@ -242,7 +242,7 @@ static GstFlowReturn gst_kate_parse_push_buffer (GstKateParse * parse, GstBuffer * buf, gint64 granulepos) { - GST_LOG_OBJECT (parse, "granulepos %16llx", granulepos); + GST_LOG_OBJECT (parse, "granulepos %16" G_GINT64_MODIFIER "x", granulepos); if (granulepos < 0) { /* packets coming not from Ogg won't have a granpos in the offset end, so we have to synthesize one here - only problem is we don't know @@ -330,7 +330,7 @@ gst_kate_parse_queue_buffer (GstKateParse * parse, GstBuffer * buf) /* oggdemux stores the granule pos in the offset end */ granpos = GST_BUFFER_OFFSET_END (buf); - GST_LOG_OBJECT (parse, "granpos %16llx", granpos); + GST_LOG_OBJECT (parse, "granpos %16" G_GINT64_MODIFIER "x", granpos); g_queue_push_tail (parse->buffer_queue, buf); #if 1 -- cgit v1.2.1