diff options
-rw-r--r-- | src/audio.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/audio.c b/src/audio.c index b1d46b3..e40b1c2 100644 --- a/src/audio.c +++ b/src/audio.c @@ -40,6 +40,7 @@ cmumble_audio_push(struct cmumble *cm, struct cmumble_user *user, */ gstbuf = gst_buffer_new_wrapped(g_memdup(data, size), size); + GST_BUFFER_FLAG_SET(gstbuf, GST_BUFFER_FLAG_LIVE); /* Asume packets are in order, since we're using tcp tunnel only atm. * FIXME: This assumption is probably wrong, since the packets may have @@ -47,19 +48,18 @@ cmumble_audio_push(struct cmumble *cm, struct cmumble_user *user, if (user->last_sequence < 0 || sequence == 0 || sequence < (user->last_sequence + 1)) { + GST_BUFFER_FLAG_SET(gstbuf, GST_BUFFER_FLAG_DISCONT); GST_BUFFER_FLAG_SET(gstbuf, GST_BUFFER_FLAG_RESYNC); time = now - base; if (cm->verbose) g_print("%s: set time to now\n", __func__); -#if 0 - /* FIXME: is this a good idea, in case the pipeline paused - * because we pushed no more buffers? */ - gst_element_set_state(user->pipeline, GST_STATE_PLAYING); -#endif } else if (sequence >= user->last_sequence + 1) { gint64 num = sequence - (user->last_sequence + 1); - time = user->last_time_end + - gst_util_uint64_scale_int(num, GST_SECOND, 100); + time = user->last_time_end; + if (num > 0) { + time += gst_util_uint64_scale_int(num, GST_SECOND, 100); + GST_BUFFER_FLAG_SET(gstbuf, GST_BUFFER_FLAG_DISCONT); + } if (cm->verbose) g_print("%s: set time by sequence: %lu, now: %lu\n", __func__, time, now - base); @@ -67,6 +67,7 @@ cmumble_audio_push(struct cmumble *cm, struct cmumble_user *user, } if (time < (now - base)) { + GST_BUFFER_FLAG_SET(gstbuf, GST_BUFFER_FLAG_DISCONT); GST_BUFFER_FLAG_SET(gstbuf, GST_BUFFER_FLAG_RESYNC); time = now - base; if (cm->verbose) |