diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-08 12:20:55 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-08 12:49:01 +0100 |
commit | 24217ee31a5030f528e13a94233580e86d70baf0 (patch) | |
tree | 6ad12532dcc277523d8ab5113fd6e11bd4c1dd85 /ext | |
parent | 282479b4434dbfd6541d71a8891943603a12de89 (diff) | |
download | gst-plugins-bad-24217ee31a5030f528e13a94233580e86d70baf0.tar.gz gst-plugins-bad-24217ee31a5030f528e13a94233580e86d70baf0.tar.bz2 gst-plugins-bad-24217ee31a5030f528e13a94233580e86d70baf0.zip |
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).
Diffstat (limited to 'ext')
-rw-r--r-- | ext/kate/gstkateenc.c | 19 | ||||
-rw-r--r-- | ext/kate/gstkateparse.c | 4 |
2 files changed, 13 insertions, 10 deletions
diff --git a/ext/kate/gstkateenc.c b/ext/kate/gstkateenc.c index fd412d34..42333509 100644 --- a/ext/kate/gstkateenc.c +++ b/ext/kate/gstkateenc.c @@ -397,7 +397,7 @@ gst_kate_enc_create_buffer (GstKateEnc * ke, kate_packet * kp, { GstBuffer *buffer; - buffer = gst_buffer_new_and_alloc (kp->nbytes); + buffer = gst_buffer_try_new_and_alloc (kp->nbytes); if (G_UNLIKELY (!buffer)) { GST_WARNING_OBJECT (ke, "Failed to allocate buffer for %u bytes", kp->nbytes); @@ -425,7 +425,7 @@ gst_kate_enc_create_buffer (GstKateEnc * ke, kate_packet * kp, static GstFlowReturn gst_kate_enc_push_buffer (GstKateEnc * ke, GstBuffer * buffer) { - GstFlowReturn rflow; + GstFlowReturn flow; ke->last_timestamp = GST_BUFFER_TIMESTAMP (buffer); if (GST_BUFFER_TIMESTAMP (buffer) + GST_BUFFER_DURATION (buffer) > @@ -437,12 +437,12 @@ gst_kate_enc_push_buffer (GstKateEnc * ke, GstBuffer * buffer) /* Hack to flush each packet on its own page - taken off the CMML encoder element */ GST_BUFFER_DURATION (buffer) = G_MAXINT64; - rflow = gst_pad_push (ke->srcpad, buffer); - if (G_UNLIKELY (rflow != GST_FLOW_OK)) { - GST_ERROR_OBJECT (ke, "Failed to push buffer: %d", rflow); + flow = gst_pad_push (ke->srcpad, buffer); + if (G_UNLIKELY (flow != GST_FLOW_OK)) { + GST_WARNING_OBJECT (ke->srcpad, "push flow: %s", gst_flow_get_name (flow)); } - return rflow; + return flow; } static GstFlowReturn @@ -548,9 +548,12 @@ gst_kate_enc_send_headers (GstKateEnc * ke) kate_packet kp; int ret = kate_encode_headers (&ke->k, &ke->kc, &kp); if (ret == 0) { - GstBuffer *buffer = - gst_kate_enc_create_buffer (ke, &kp, 0ll, 0ll, 0ll, TRUE); + GstBuffer *buffer; + + buffer = gst_kate_enc_create_buffer (ke, &kp, 0, 0, 0, TRUE); if (!buffer) { + GST_ELEMENT_ERROR (ke, STREAM, ENCODE, (NULL), + ("Failed to create buffer, %u bytes", kp.nbytes)); rflow = GST_FLOW_ERROR; break; } 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 |