aboutsummaryrefslogtreecommitdiff
path: root/src/discourse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/discourse.c')
-rw-r--r--src/discourse.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/discourse.c b/src/discourse.c
index 358c63b..8f1ef8c 100644
--- a/src/discourse.c
+++ b/src/discourse.c
@@ -353,7 +353,9 @@ discourse_subscription_stream_message(MESSENGER_DiscourseSubscriptionInfo *info,
353 { 353 {
354 const uint32_t rtp_timestamp = gst_rtp_buffer_get_timestamp(&rtp); 354 const uint32_t rtp_timestamp = gst_rtp_buffer_get_timestamp(&rtp);
355 355
356 gst_rtp_buffer_ext_timestamp(&timestamp, rtp_timestamp); 356 timestamp = gst_rtp_buffer_ext_timestamp(&timestamp, rtp_timestamp);
357 if (!timestamp)
358 timestamp = rtp_timestamp;
357 359
358 gst_rtp_buffer_unmap(&rtp); 360 gst_rtp_buffer_unmap(&rtp);
359 } 361 }
@@ -361,7 +363,8 @@ discourse_subscription_stream_message(MESSENGER_DiscourseSubscriptionInfo *info,
361 info->buffers = g_list_append(info->buffers, buffer); 363 info->buffers = g_list_append(info->buffers, buffer);
362 buffer = NULL; 364 buffer = NULL;
363 365
364 if (info->last_timestamp == timestamp) 366 if ((info->last_timestamp == timestamp) ||
367 ((!(info->last_timestamp)) && (!(info->position))))
365 goto skip_buffer; 368 goto skip_buffer;
366 369
367 buffer = gst_buffer_new(); 370 buffer = gst_buffer_new();
@@ -398,9 +401,10 @@ discourse_subscription_stream_message(MESSENGER_DiscourseSubscriptionInfo *info,
398 g_signal_emit_by_name(appsrc, "push-buffer", buffer, &ret); 401 g_signal_emit_by_name(appsrc, "push-buffer", buffer, &ret);
399 402
400 info->position += duration; 403 info->position += duration;
401 info->last_timestamp = timestamp;
402 404
403skip_buffer: 405skip_buffer:
406 info->last_timestamp = timestamp;
407
404 if (buffer) 408 if (buffer)
405 gst_buffer_unref(buffer); 409 gst_buffer_unref(buffer);
406 410