]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/audiounit_ios.c
macosx: move fullscreen-related method to VideoWindowCommon class
[vlc] / modules / audio_output / audiounit_ios.c
index e4d28cce0db17e2029d6a636659df62159f774ce..1faaf589e9afe357cddab06e7982faea565bef2f 100644 (file)
  *****************************************************************************/
 struct aout_sys_t
 {
-    uint8_t                     chans_to_reorder;   /* do we need channel reordering */
-    uint8_t                     chan_table[AOUT_CHAN_MAX];
-
-    UInt32                      i_numberOfChannels;
     TPCircularBuffer            circular_buffer;    /* circular buffer to swap the audio data */
 
     /* AUHAL specific */
@@ -71,8 +67,6 @@ struct aout_sys_t
     int                         i_rate;             /* media sample rate */
     int                         i_bytes_per_sample;
     bool                        b_got_first_sample;
-
-    vlc_mutex_t                 lock;
 };
 
 #pragma mark -
@@ -110,8 +104,6 @@ static int Open(vlc_object_t *obj)
     if (unlikely(sys == NULL))
         return VLC_ENOMEM;
 
-    vlc_mutex_init(&sys->lock);
-
     aout->sys = sys;
     aout->start = Start;
     aout->stop = Stop;
@@ -124,8 +116,6 @@ static void Close(vlc_object_t *obj)
     audio_output_t *aout = (audio_output_t *)obj;
     aout_sys_t *sys = aout->sys;
 
-    vlc_mutex_destroy(&sys->lock);
-
     free(sys);
 }
 
@@ -163,7 +153,6 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
     UInt32                      i_param_size = 0;
     AudioComponentDescription   desc;
     AURenderCallbackStruct      callback;
-    p_aout->sys->chans_to_reorder = 0;
     OSStatus status;
 
     /* Lets go find our Component */
@@ -314,15 +303,6 @@ static void Play (audio_output_t * p_aout, block_t * p_block)
             p_sys->b_got_first_sample = true;
         }
 
-        /* Do the channel reordering */
-        if (p_sys->chans_to_reorder) {
-           aout_ChannelReorder(p_block->p_buffer,
-                               p_block->i_buffer,
-                               p_sys->chans_to_reorder,
-                               p_sys->chan_table,
-                               VLC_CODEC_FL32);
-        }
-
         /* move data to buffer */
         if (unlikely(!TPCircularBufferProduceBytes(&p_sys->circular_buffer, p_block->p_buffer, p_block->i_buffer)))
             msg_Warn(p_aout, "Audio buffer was dropped");
@@ -403,9 +383,8 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
 
     /* check if we have enough data */
     if (!availableBytes) {
-        /* return an empty buffer so silence is played until we have data */
-        for (UInt32 j = 0; j < inNumberFrames; j++)
-            targetBuffer[j] = 0.;
+        /* bail out and restart unit the next time we receive some data */
+        Flush(p_aout, false);
     } else {
         memcpy(targetBuffer, buffer, __MIN(bytesToCopy, availableBytes));
         TPCircularBufferConsume(&p_sys->circular_buffer, __MIN(bytesToCopy, availableBytes));