summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjk7744.park <jk7744.park@samsung.com>2016-02-24 18:29:14 +0900
committerjk7744.park <jk7744.park@samsung.com>2016-02-24 18:29:14 +0900
commite43d1e980bb2117c374295b7c65041353e4cee95 (patch)
tree4b250289f8535d7150c8ddec7adfe6a267ee969c
parent32e864f0f32b7628d995e84d07646b01dc5bf2d5 (diff)
downloadgst-plugins-good-tizen_2.4.tar.gz
gst-plugins-good-tizen_2.4.tar.bz2
gst-plugins-good-tizen_2.4.zip
Tizen 2.4.0 rev3 SDK Public Releasetizen_2.4
-rw-r--r--ext/pulse/pulsesink.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
index 6850297..882818f 100644
--- a/ext/pulse/pulsesink.c
+++ b/ext/pulse/pulsesink.c
@@ -996,6 +996,7 @@ gst_pulseringbuffer_acquire (GstAudioRingBuffer * buf,
int vol,gain;
const char *policy_str = NULL;
const char *cur_policy = NULL;
+ pa_sample_spec ss;
#endif /* __TIZEN__ */
psink = GST_PULSESINK_CAST (GST_OBJECT_PARENT (buf));
@@ -1145,8 +1146,11 @@ gst_pulseringbuffer_acquire (GstAudioRingBuffer * buf,
memset (&wanted, 0, sizeof (wanted));
#ifdef __TIZEN__
if (cur_policy && strcmp (cur_policy, "voip") == 0) {
- wanted.minreq = pa_usec_to_bytes(20*PA_USEC_PER_MSEC, pa_stream_get_sample_spec(pbuf->stream));
- wanted.tlength = pa_usec_to_bytes(100*PA_USEC_PER_MSEC, pa_stream_get_sample_spec(pbuf->stream));
+ ss.format = PA_SAMPLE_S16LE;
+ ss.rate = spec->info.rate; //spec->rate;
+ ss.channels = pbuf->channels;
+ wanted.minreq = pa_usec_to_bytes(20*PA_USEC_PER_MSEC, &ss);
+ wanted.tlength = pa_usec_to_bytes(100*PA_USEC_PER_MSEC, &ss);
wanted.maxlength = -1;
wanted.prebuf = -1;
} else {
@@ -1479,11 +1483,6 @@ gst_pulseringbuffer_pause (GstAudioRingBuffer * buf)
GstPulseRingBuffer *pbuf;
gboolean res;
-#ifdef __TIZEN__
- const pa_timing_info *info;
- pa_usec_t current_time = 0, written_time = 0;
-#endif /* __TIZEN__ */
-
pbuf = GST_PULSERING_BUFFER_CAST (buf);
psink = GST_PULSESINK_CAST (GST_OBJECT_PARENT (pbuf));
@@ -1497,25 +1496,6 @@ gst_pulseringbuffer_pause (GstAudioRingBuffer * buf)
GST_DEBUG_OBJECT (psink, "signal commit");
pa_threaded_mainloop_signal (mainloop, 0);
}
-
-#ifdef __TIZEN__
- /* compensation between paused time and written buffer time */
- if ((info = pa_stream_get_timing_info (pbuf->stream))) {
- /* get current time */
- if (pa_stream_get_time (pbuf->stream, &current_time) < 0) {
- GST_DEBUG_OBJECT (psink, "could not get current time");
- } else {
- written_time = pa_bytes_to_usec(info->write_index, pa_stream_get_sample_spec(pbuf->stream));
- if (written_time > current_time) {
- /* update pause time according to amount of written buffer */
- pa_stream_set_pause_time_offset(pbuf->stream, written_time - current_time);
- GST_DEBUG_OBJECT (psink, "update pause time %" G_GUINT64_FORMAT " usec + offset %" G_GUINT64_FORMAT " usec",
- current_time, written_time - current_time);
- }
- }
- }
-#endif /* __TIZEN__ */
-
pa_threaded_mainloop_unlock (mainloop);
return res;