+/**
+ * When there are one or more pending corks, playback should be paused.
+ * This is used for audio policy.
+ * \warning Always add and remove a cork with var_IncInteger() and var_DecInteger().
+ * var_Get() and var_Set() are prone to race conditions.
+ */
+static int CorksCallback( vlc_object_t *obj, char const *var,
+ vlc_value_t old, vlc_value_t cur, void *dummy )
+{
+ playlist_t *pl = (playlist_t *)obj;
+
+ msg_Dbg( obj, "corks count: %"PRId64" -> %"PRId64, old.i_int, cur.i_int );
+ if( !old.i_int == !cur.i_int )
+ return VLC_SUCCESS; /* nothing to do */
+
+ if( cur.i_int )
+ {
+ if( var_InheritBool( obj, "playlist-cork" ) )
+ {
+ msg_Dbg( obj, "corked" );
+ playlist_Pause( pl );
+ }
+ else
+ msg_Dbg( obj, "not corked" );
+ }
+ else
+ msg_Dbg( obj, "uncorked" );
+
+ (void) var; (void) dummy;
+ return VLC_SUCCESS;
+}
+