diff options
-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 |