#11398: "avfoundation" audio capture had missing samples randomly
--------------------------------------+------------------------------------
             Reporter:  drobinson     |                    Owner:  (none)
                 Type:  defect        |                   Status:  new
             Priority:  normal        |                Component:  avdevice
              Version:  7.1           |               Resolution:
             Keywords:  avfoundation  |               Blocked By:
             Blocking:                |  Reproduced by developer:  0
Analyzed by developer:  1             |
--------------------------------------+------------------------------------
Comment (by MasterQuestionable):

 ͏    Difference:
 {{{#!diff
 --- avfoundation_audio_fifo.patch       2025-01-05T16:19:29Z
 +++ avfoundation_audio_fifo-v2.patch    2025-01-06T01:18:05Z
 @@ -18,10 +18,12 @@
  +static void push_frame(AVFFrameList* list, CMSampleBufferRef frame)
  +{
  +    list->frames[list->write_index] =
 (CMSampleBufferRef)CFRetain(frame);
  +    list->write_index = (list->write_index + 1) % AVF_FRAME_LIST_LENGTH;
  +
  +    if (list->write_index == list->read_index) {
 -+        CFRelease(list->frames[list->read_index]);
 -+        list->read_index = (list->read_index + 1) %
 AVF_FRAME_LIST_LENGTH;
 ++        for (int i = 0; i < (AVF_FRAME_LIST_LENGTH / 2); ++i) {
 ++            CFRelease(list->frames[list->read_index]);
 ++            list->read_index = (list->read_index + 1) %
 AVF_FRAME_LIST_LENGTH;
 ++        }
  +    }
  +}
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11398#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to