]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/pulse.c
CC: use c99, removed dummy Eia608Exit
[vlc] / modules / audio_output / pulse.c
index 61fe648b727079569f2176cb0e375f33bfec3baf..80d44902e45d12e0a37ae36a4399cd8ed75c13de 100644 (file)
@@ -32,7 +32,7 @@
 #include <vlc_cpu.h>
 
 #include <pulse/pulseaudio.h>
-#include <vlc_pulse.h>
+#include "vlcpulse.h"
 #if !PA_CHECK_VERSION(0,9,22)
 # include <vlc_xlib.h>
 #endif
@@ -50,17 +50,9 @@ vlc_module_begin ()
     set_callbacks( Open, Close )
 vlc_module_end ()
 
-/* TODO:
- * - pause input on policy event
- * - resample to compensate for long term drift
- * - select music or video stream property correctly (?)
- * - set further appropriate stream properties
- * - update output devices list dynamically
- */
-
 /* NOTE:
  * Be careful what you do when the PulseAudio mainloop is held, which is to say
- * within PulseAudio callbacks, or after vlc_pa_lock().
+ * within PulseAudio callbacks, or after pa_threaded_mainloop_lock().
  * In particular, a VLC variable callback cannot be triggered nor deleted with
  * the PulseAudio mainloop lock held, if the callback acquires the lock. */
 
@@ -68,6 +60,7 @@ struct aout_sys_t
 {
     pa_stream *stream; /**< PulseAudio playback stream object */
     pa_context *context; /**< PulseAudio connection context */
+    pa_threaded_mainloop *mainloop; /**< PulseAudio thread */
     pa_time_event *trigger; /**< Deferred stream trigger */
     pa_volume_t base_volume; /**< 0dB reference volume */
     pa_cvolume cvolume; /**< actual sink input volume */
@@ -77,6 +70,7 @@ struct aout_sys_t
     unsigned rate; /**< Current stream sample rate */
 };
 
+static void sink_list_cb(pa_context *, const pa_sink_info *, int, void *);
 static void sink_input_info_cb(pa_context *, const pa_sink_input_info *,
                                int, void *);
 
@@ -90,6 +84,23 @@ static void context_cb(pa_context *ctx, pa_subscription_event_type_t type,
 
     switch (type & PA_SUBSCRIPTION_EVENT_FACILITY_MASK)
     {
+      case PA_SUBSCRIPTION_EVENT_SINK:
+        switch (type & PA_SUBSCRIPTION_EVENT_TYPE_MASK)
+        {
+          case PA_SUBSCRIPTION_EVENT_NEW:
+          case PA_SUBSCRIPTION_EVENT_CHANGE:
+            op = pa_context_get_sink_info_by_index(ctx, idx, sink_list_cb, aout);
+            if (likely(op != NULL))
+                pa_operation_unref(op);
+            break;
+
+          case PA_SUBSCRIPTION_EVENT_REMOVE:
+            var_Change(aout, "audio-device", VLC_VAR_DELCHOICE,
+                       &(vlc_value_t){ .i_int = idx }, NULL);
+            break;
+        }
+        break;
+
       case PA_SUBSCRIPTION_EVENT_SINK_INPUT:
         if (idx != pa_stream_get_index(sys->stream))
             break; /* only interested in our sink input */
@@ -131,7 +142,14 @@ static void sink_list_cb(pa_context *c, const pa_sink_info *i, int eol,
             i->description);
     val.i_int = i->index;
     text.psz_string = (char *)i->description;
+    /* FIXME: There is no way to replace a choice explicitly. */
+    var_Change(aout, "audio-device", VLC_VAR_DELCHOICE, &val, NULL);
     var_Change(aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text);
+    /* FIXME: var_Change() can change the variable value if we remove the
+     * current value from the choice list, or if we add a choice while there
+     * was none. So force the correct value back. */
+    val.i_int = pa_stream_get_device_index(aout->sys->stream);
+    var_Change(aout, "audio-device", VLC_VAR_SETVALUE, &val, NULL);
 }
 
 static void sink_info_cb(pa_context *c, const pa_sink_info *i, int eol,
@@ -158,20 +176,6 @@ static void sink_info_cb(pa_context *c, const pa_sink_info *i, int eol,
 
 
 /*** Latency management and lip synchronization ***/
-static mtime_t vlc_pa_get_latency(audio_output_t *aout,
-                                  pa_context *ctx, pa_stream *s)
-{
-    pa_usec_t latency;
-    int negative;
-
-    if (pa_stream_get_latency(s, &latency, &negative)) {
-        if (pa_context_errno (ctx) != PA_ERR_NODATA)
-            vlc_pa_error(aout, "unknown latency", ctx);
-        return VLC_TS_INVALID;
-    }
-    return negative ? -latency : +latency;
-}
-
 static void stream_reset_sync(pa_stream *s, audio_output_t *aout)
 {
     aout_sys_t *sys = aout->sys;
@@ -191,10 +195,7 @@ static void stream_start(pa_stream *s, audio_output_t *aout)
     aout_sys_t *sys = aout->sys;
     pa_operation *op;
 
-    if (sys->trigger != NULL) {
-        vlc_pa_rttime_free(sys->trigger);
-        sys->trigger = NULL;
-    }
+    assert (sys->trigger == NULL);
 
     op = pa_stream_cork(s, 0, NULL, NULL);
     if (op != NULL)
@@ -210,7 +211,7 @@ static void stream_stop(pa_stream *s, audio_output_t *aout)
     pa_operation *op;
 
     if (sys->trigger != NULL) {
-        vlc_pa_rttime_free(sys->trigger);
+        vlc_pa_rttime_free(sys->mainloop, sys->trigger);
         sys->trigger = NULL;
     }
 
@@ -225,8 +226,11 @@ static void stream_trigger_cb(pa_mainloop_api *api, pa_time_event *e,
     audio_output_t *aout = userdata;
     aout_sys_t *sys = aout->sys;
 
-    msg_Dbg(aout, "starting deferred");
     assert (sys->trigger == e);
+
+    msg_Dbg(aout, "starting deferred");
+    vlc_pa_rttime_free(sys->mainloop, sys->trigger);
+    sys->trigger = NULL;
     stream_start(sys->stream, aout);
     (void) api; (void) e; (void) tv;
 }
@@ -242,21 +246,25 @@ static void stream_resync(audio_output_t *aout, pa_stream *s)
     aout_sys_t *sys = aout->sys;
     mtime_t delta;
 
-    assert (pa_stream_is_corked(s) > 0);
     assert (sys->pts != VLC_TS_INVALID);
 
+    if (sys->trigger != NULL) {
+        vlc_pa_rttime_free(sys->mainloop, sys->trigger);
+        sys->trigger = NULL;
+    }
+
     delta = vlc_pa_get_latency(aout, sys->context, s);
-    if (unlikely(delta == VLC_TS_INVALID))
+    if (unlikely(delta == VLC_TS_INVALID)) {
+        msg_Dbg(aout, "cannot synchronize start");
         delta = 0; /* screwed */
+    }
 
     delta = (sys->pts - mdate()) - delta;
     if (delta > 0) {
-        if (sys->trigger == NULL) {
-            msg_Dbg(aout, "deferring start (%"PRId64" us)", delta);
-            delta += pa_rtclock_now();
-            sys->trigger = pa_context_rttime_new(sys->context, delta,
-                                                 stream_trigger_cb, aout);
-        }
+        msg_Dbg(aout, "deferring start (%"PRId64" us)", delta);
+        delta += pa_rtclock_now();
+        sys->trigger = pa_context_rttime_new(sys->context, delta,
+                                             stream_trigger_cb, aout);
     } else {
         msg_Warn(aout, "starting late (%"PRId64" us)", delta);
         stream_start(s, aout);
@@ -269,13 +277,16 @@ static void stream_latency_cb(pa_stream *s, void *userdata)
     aout_sys_t *sys = aout->sys;
     mtime_t delta, change;
 
-    if (pa_stream_is_corked(s))
-        return;
-    if (sys->pts == VLC_TS_INVALID)
-    {
+    if (sys->paused != VLC_TS_INVALID)
+        return; /* nothing to do while paused */
+    if (sys->pts == VLC_TS_INVALID) {
         msg_Dbg(aout, "missing latency from input");
         return;
     }
+    if (pa_stream_is_corked(s) > 0) {
+        stream_resync(aout, s);
+        return;
+    }
 
     /* Compute lip desynchronization */
     delta = vlc_pa_get_latency(aout, sys->context, s);
@@ -344,15 +355,16 @@ static void stream_latency_cb(pa_stream *s, void *userdata)
 /*** Stream helpers ***/
 static void stream_state_cb(pa_stream *s, void *userdata)
 {
+    pa_threaded_mainloop *mainloop = userdata;
+
     switch (pa_stream_get_state(s)) {
         case PA_STREAM_READY:
         case PA_STREAM_FAILED:
         case PA_STREAM_TERMINATED:
-            vlc_pa_signal(0);
+            pa_threaded_mainloop_signal(mainloop, 0);
         default:
             break;
     }
-    (void) userdata;
 }
 
 static void stream_event_cb(pa_stream *s, const char *name, pa_proplist *pl,
@@ -360,6 +372,12 @@ static void stream_event_cb(pa_stream *s, const char *name, pa_proplist *pl,
 {
     audio_output_t *aout = userdata;
 
+    if (!strcmp(name, PA_STREAM_EVENT_REQUEST_CORK))
+        aout_PolicyReport(aout, true);
+    else
+    if (!strcmp(name, PA_STREAM_EVENT_REQUEST_UNCORK))
+        aout_PolicyReport(aout, false);
+    else
 #if PA_CHECK_VERSION(1,0,0)
     /* FIXME: expose aout_Restart() directly */
     if (!strcmp(name, PA_STREAM_EVENT_FORMAT_LOST)) {
@@ -370,7 +388,7 @@ static void stream_event_cb(pa_stream *s, const char *name, pa_proplist *pl,
                               dummy, dummy, NULL);
     } else
 #endif
-        msg_Warn (aout, "unhandled event %s", name);
+        msg_Warn (aout, "unhandled stream event \"%s\"", name);
     (void) s;
     (void) pl;
 }
@@ -407,9 +425,13 @@ static void stream_moved_cb(pa_stream *s, void *userdata)
 static void stream_overflow_cb(pa_stream *s, void *userdata)
 {
     audio_output_t *aout = userdata;
+    pa_operation *op;
 
-    msg_Err(aout, "overflow");
-    (void) s;
+    msg_Err(aout, "overflow, flushing");
+    op = pa_stream_flush(s, NULL, NULL);
+    if (likely(op != NULL))
+        pa_operation_unref(op);
+    stream_reset_sync(s, aout);
 }
 
 static void stream_started_cb(pa_stream *s, void *userdata)
@@ -437,14 +459,14 @@ static void stream_underflow_cb(pa_stream *s, void *userdata)
     stream_reset_sync(s, aout);
 }
 
-static int stream_wait(pa_stream *stream)
+static int stream_wait(pa_stream *stream, pa_threaded_mainloop *mainloop)
 {
     pa_stream_state_t state;
 
     while ((state = pa_stream_get_state(stream)) != PA_STREAM_READY) {
         if (state == PA_STREAM_FAILED || state == PA_STREAM_TERMINATED)
             return -1;
-        vlc_pa_wait();
+        pa_threaded_mainloop_wait(mainloop);
     }
     return 0;
 }
@@ -456,15 +478,17 @@ static void sink_input_info_cb(pa_context *ctx, const pa_sink_input_info *i,
 {
     audio_output_t *aout = userdata;
     aout_sys_t *sys = aout->sys;
-    float volume;
 
     if (eol)
         return;
     (void) ctx;
 
-    sys->cvolume = i->volume;
-    volume = pa_cvolume_max(&i->volume) / (float)PA_VOLUME_NORM;
-    aout_VolumeHardSet(aout, volume, i->mute);
+    sys->cvolume = i->volume; /* cache volume for balance preservation */
+
+    pa_volume_t volume = pa_cvolume_max(&i->volume);
+    volume = pa_sw_volume_divide(volume, sys->base_volume);
+    aout_VolumeReport(aout, (float)volume / PA_VOLUME_NORM);
+    aout_MuteReport(aout, i->mute);
 }
 
 
@@ -495,13 +519,15 @@ static void *data_convert(block_t **pp)
 }
 
 /**
- * Queue one audio frame to the playabck stream
+ * Queue one audio frame to the playback stream
  */
-static void Play(audio_output_t *aout, block_t *block)
+static void Play(audio_output_t *aout, block_t *block, mtime_t *restrict drift)
 {
     aout_sys_t *sys = aout->sys;
     pa_stream *s = sys->stream;
 
+    assert (sys->paused == VLC_TS_INVALID);
+
     const void *ptr = data_convert(&block);
     if (unlikely(ptr == NULL))
         return;
@@ -514,7 +540,7 @@ static void Play(audio_output_t *aout, block_t *block)
      * output FIFO lock while the PulseAudio threaded main loop lock is held
      * (including from PulseAudio stream callbacks). Otherwise lock inversion
      * will take place, and sooner or later a deadlock. */
-    vlc_pa_lock();
+    pa_threaded_mainloop_lock(sys->mainloop);
 
     sys->pts = pts;
     if (pa_stream_is_corked(s) > 0)
@@ -533,7 +559,8 @@ static void Play(audio_output_t *aout, block_t *block)
         block_Release(block);
     }
 
-    vlc_pa_unlock();
+    pa_threaded_mainloop_unlock(sys->mainloop);
+    (void) drift;
 }
 
 /**
@@ -544,7 +571,7 @@ static void Pause(audio_output_t *aout, bool paused, mtime_t date)
     aout_sys_t *sys = aout->sys;
     pa_stream *s = sys->stream;
 
-    vlc_pa_lock();
+    pa_threaded_mainloop_lock(sys->mainloop);
 
     if (paused) {
         sys->paused = date;
@@ -558,7 +585,7 @@ static void Pause(audio_output_t *aout, bool paused, mtime_t date)
         stream_resync(aout, s);
     }
 
-    vlc_pa_unlock();
+    pa_threaded_mainloop_unlock(sys->mainloop);
 }
 
 /**
@@ -570,7 +597,7 @@ static void Flush(audio_output_t *aout, bool wait)
     pa_stream *s = sys->stream;
     pa_operation *op;
 
-    vlc_pa_lock();
+    pa_threaded_mainloop_lock(sys->mainloop);
 
     if (wait)
         op = pa_stream_drain(s, NULL, NULL);
@@ -579,39 +606,50 @@ static void Flush(audio_output_t *aout, bool wait)
         op = pa_stream_flush(s, NULL, NULL);
     if (op != NULL)
         pa_operation_unref(op);
-    vlc_pa_unlock();
+    pa_threaded_mainloop_unlock(sys->mainloop);
 }
 
-static int VolumeSet(audio_output_t *aout, float vol, bool mute)
+static int VolumeSet(audio_output_t *aout, float vol)
 {
     aout_sys_t *sys = aout->sys;
     pa_operation *op;
     uint32_t idx = pa_stream_get_index(sys->stream);
 
-    pa_cvolume cvolume = sys->cvolume;
-    pa_volume_t volume = sys->base_volume;
-
-    pa_cvolume_scale(&cvolume, PA_VOLUME_NORM); /* preserve balance */
-
     /* VLC provides the software volume so convert directly to PulseAudio
      * software volume, pa_volume_t. This is not a linear amplification factor
      * so do not use PulseAudio linear amplification! */
     vol *= PA_VOLUME_NORM;
     if (unlikely(vol >= PA_VOLUME_MAX))
         vol = PA_VOLUME_MAX;
-    volume = pa_sw_volume_multiply(volume, lround(vol));
+    pa_volume_t volume = pa_sw_volume_multiply(lround(vol), sys->base_volume);
+
+    /* Preserve the balance (VLC does not support it). */
+    pa_cvolume cvolume = sys->cvolume;
+    pa_cvolume_scale(&cvolume, PA_VOLUME_NORM);
     pa_sw_cvolume_multiply_scalar(&cvolume, &cvolume, volume);
 
     assert(pa_cvolume_valid(&cvolume));
 
-    vlc_pa_lock();
+    pa_threaded_mainloop_lock(sys->mainloop);
     op = pa_context_set_sink_input_volume(sys->context, idx, &cvolume, NULL, NULL);
     if (likely(op != NULL))
         pa_operation_unref(op);
+    pa_threaded_mainloop_unlock(sys->mainloop);
+
+    return 0;
+}
+
+static int MuteSet(audio_output_t *aout, bool mute)
+{
+    aout_sys_t *sys = aout->sys;
+    pa_operation *op;
+    uint32_t idx = pa_stream_get_index(sys->stream);
+
+    pa_threaded_mainloop_lock(sys->mainloop);
     op = pa_context_set_sink_input_mute(sys->context, idx, mute, NULL, NULL);
     if (likely(op != NULL))
         pa_operation_unref(op);
-    vlc_pa_unlock();
+    pa_threaded_mainloop_unlock(sys->mainloop);
 
     return 0;
 }
@@ -628,7 +666,7 @@ static int StreamMove(vlc_object_t *obj, const char *varname, vlc_value_t old,
 
     (void) varname; (void) old;
 
-    vlc_pa_lock();
+    pa_threaded_mainloop_lock(sys->mainloop);
     op = pa_context_move_sink_input_by_index(sys->context, idx, sink_idx,
                                              NULL, NULL);
     if (likely(op != NULL)) {
@@ -636,7 +674,7 @@ static int StreamMove(vlc_object_t *obj, const char *varname, vlc_value_t old,
         msg_Dbg(aout, "moving to sink %"PRIu32, sink_idx);
     } else
         vlc_pa_error(obj, "cannot move sink", sys->context);
-    vlc_pa_unlock();
+    pa_threaded_mainloop_unlock(sys->mainloop);
 
     return (op != NULL) ? VLC_SUCCESS : VLC_EGENERIC;
 }
@@ -674,10 +712,6 @@ static int Open(vlc_object_t *obj)
         case VLC_CODEC_F32L:
             ss.format = PA_SAMPLE_FLOAT32LE;
             break;
-        case VLC_CODEC_FI32:
-            format = VLC_CODEC_FL32;
-            ss.format = PA_SAMPLE_FLOAT32NE;
-            break;
         case VLC_CODEC_S32B:
             ss.format = PA_SAMPLE_S32BE;
             break;
@@ -788,6 +822,7 @@ static int Open(vlc_object_t *obj)
     /* Stream parameters */
     const pa_stream_flags_t flags = PA_STREAM_START_CORKED
                                   //| PA_STREAM_INTERPOLATE_TIMING
+                                    | PA_STREAM_NOT_MONOTONIC
                                   | PA_STREAM_AUTO_TIMING_UPDATE
                                   | PA_STREAM_VARIABLE_RATE;
 
@@ -809,7 +844,7 @@ static int Open(vlc_object_t *obj)
     if (unlikely(sys == NULL))
         return VLC_ENOMEM;
 
-    pa_context *ctx = vlc_pa_connect (obj);
+    pa_context *ctx = vlc_pa_connect(obj, &sys->mainloop);
     if (ctx == NULL)
     {
         free (sys);
@@ -825,14 +860,6 @@ static int Open(vlc_object_t *obj)
     sys->desync = 0;
     sys->rate = ss.rate;
 
-    /* Context events */
-    const pa_subscription_mask_t mask = PA_SUBSCRIPTION_MASK_SINK_INPUT;
-
-    pa_context_set_subscribe_callback(ctx, context_cb, aout);
-    op = pa_context_subscribe(ctx, mask, NULL, NULL);
-    if (likely(op != NULL))
-       pa_operation_unref(op);
-
     /* Channel volume */
     sys->base_volume = PA_VOLUME_NORM;
     pa_cvolume_set(&sys->cvolume, ss.channels, PA_VOLUME_NORM);
@@ -847,6 +874,7 @@ static int Open(vlc_object_t *obj)
         formatv[formatc]->encoding = encoding;
         pa_format_info_set_rate(formatv[formatc], ss.rate);
         pa_format_info_set_channels(formatv[formatc], ss.channels);
+        pa_format_info_set_channel_map(formatv[formatc], &map);
         formatc++;
     }
 
@@ -856,18 +884,25 @@ static int Open(vlc_object_t *obj)
     pa_format_info_set_sample_format(formatv[formatc], ss.format);
     pa_format_info_set_rate(formatv[formatc], ss.rate);
     pa_format_info_set_channels(formatv[formatc], ss.channels);
+    pa_format_info_set_channel_map(formatv[formatc], &map);
     formatc++;
 
     /* Create a playback stream */
     pa_stream *s;
+    pa_proplist *props = pa_proplist_new();
+    if (likely(props != NULL))
+        /* TODO: set other stream properties */
+        pa_proplist_sets (props, PA_PROP_MEDIA_ROLE, "video");
 
-    vlc_pa_lock();
-    s = pa_stream_new_extended(ctx, "audio stream", formatv, formatc, NULL);
+    pa_threaded_mainloop_lock(sys->mainloop);
+    s = pa_stream_new_extended(ctx, "audio stream", formatv, formatc, props);
+    if (likely(props != NULL))
+        pa_proplist_free(props);
 
     for (unsigned i = 0; i < formatc; i++)
         pa_format_info_free(formatv[i]);
 #else
-    vlc_pa_lock();
+    pa_threaded_mainloop_lock(sys->mainloop);
     pa_stream *s = pa_stream_new(ctx, "audio stream", &ss, &map);
 #endif
     if (s == NULL) {
@@ -875,7 +910,7 @@ static int Open(vlc_object_t *obj)
         goto fail;
     }
     sys->stream = s;
-    pa_stream_set_state_callback(s, stream_state_cb, NULL);
+    pa_stream_set_state_callback(s, stream_state_cb, sys->mainloop);
     pa_stream_set_event_callback(s, stream_event_cb, aout);
     pa_stream_set_latency_update_callback(s, stream_latency_cb, aout);
     pa_stream_set_moved_callback(s, stream_moved_cb, aout);
@@ -885,7 +920,7 @@ static int Open(vlc_object_t *obj)
     pa_stream_set_underflow_callback(s, stream_underflow_cb, aout);
 
     if (pa_stream_connect_playback(s, NULL, &attr, flags, NULL, NULL) < 0
-     || stream_wait(s)) {
+     || stream_wait(s, sys->mainloop)) {
         vlc_pa_error(obj, "stream connection failure", ctx);
         goto fail;
     }
@@ -920,17 +955,26 @@ static int Open(vlc_object_t *obj)
     if (op != NULL)
         pa_operation_unref(op);
     stream_moved_cb(s, aout);
-    vlc_pa_unlock();
+
+    /* Context events */
+    const pa_subscription_mask_t mask = PA_SUBSCRIPTION_MASK_SINK
+                                      | PA_SUBSCRIPTION_MASK_SINK_INPUT;
+    pa_context_set_subscribe_callback(ctx, context_cb, aout);
+    op = pa_context_subscribe(ctx, mask, NULL, NULL);
+    if (likely(op != NULL))
+       pa_operation_unref(op);
+    pa_threaded_mainloop_unlock(sys->mainloop);
 
     aout->format.i_format = format;
     aout->pf_play = Play;
     aout->pf_pause = Pause;
     aout->pf_flush = Flush;
-    aout_VolumeHardInit (aout, VolumeSet);
+    aout->volume_set = VolumeSet;
+    aout->mute_set = MuteSet;
     return VLC_SUCCESS;
 
 fail:
-    vlc_pa_unlock();
+    pa_threaded_mainloop_unlock(sys->mainloop);
     Close(obj);
     return VLC_EGENERIC;
 }
@@ -950,9 +994,9 @@ static void Close (vlc_object_t *obj)
         var_DelCallback (aout, "audio-device", StreamMove, s);
         var_Destroy (aout, "audio-device");
 
-        vlc_pa_lock ();
+        pa_threaded_mainloop_lock(sys->mainloop);
         if (unlikely(sys->trigger != NULL))
-            vlc_pa_rttime_free(sys->trigger);
+            vlc_pa_rttime_free(sys->mainloop, sys->trigger);
         pa_stream_disconnect(s);
 
         /* Clear all callbacks */
@@ -964,11 +1008,12 @@ static void Close (vlc_object_t *obj)
         pa_stream_set_started_callback(s, NULL, NULL);
         pa_stream_set_suspended_callback(s, NULL, NULL);
         pa_stream_set_underflow_callback(s, NULL, NULL);
+        pa_context_set_subscribe_callback(ctx, NULL, NULL);
 
         pa_stream_unref(s);
-        vlc_pa_unlock ();
+        pa_threaded_mainloop_unlock(sys->mainloop);
     }
 
-    vlc_pa_disconnect(obj, ctx);
+    vlc_pa_disconnect(obj, ctx, sys->mainloop);
     free(sys);
 }