Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 812a4cd88295f97f134a61e9f7a3621530188f4c
      
https://github.com/WebKit/WebKit/commit/812a4cd88295f97f134a61e9f7a3621530188f4c
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2025-10-01 (Wed, 01 Oct 2025)

  Changed paths:
    A LayoutTests/http/wpt/mediarecorder/record-96KHz-long-mp4-expected.txt
    A LayoutTests/http/wpt/mediarecorder/record-96KHz-long-mp4.html
    M LayoutTests/platform/gtk/TestExpectations
    M LayoutTests/platform/wpe/TestExpectations
    M Source/WebCore/platform/mediarecorder/MediaRecorderPrivateWriter.cpp
    M Source/WebCore/platform/mediarecorder/MediaRecorderPrivateWriter.h
    M 
Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterAVFObjC.h
    M 
Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterAVFObjC.mm
    M 
Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterWebM.cpp
    M 
Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterWebM.h

  Log Message:
  -----------
  REGRESSION (iOS 26): MediaRecorder produces corrupted video/audio files, 
resulting in some loss of content
https://bugs.webkit.org/show_bug.cgi?id=299164
rdar://160982017

Reviewed by Youenn Fablet.

In typical usage, a MediaRecorder is configured to generate segments of a 
finite size.
However, in the provided reproduction steps, no size are provided and the
audio recordings will be as long as the duration between the recording starting
and the recording being stopped.
When writing the last segment, if the AVAssetWriterInput reported not to be
ready for more data, we would abort in the expectation that another fetchData
would be called that would flush the remaining samples. However, this last 
fetchData
will never occur.

The MediaRecorderPrivateWriterAVFObjC made the incorrect assumptions that
the AVAssetWriterInput would always be accepting more content as we only feed
it compressed, interleaved sample. This assumption turned out to be false.

When closing the recording, we now pass to the writer all the pending samples
and write them asynchronously using the appropriate AVAssetWriterInput's APIs
that ensure writes are delayed until ready.
We now call AVAssetWriterInput as per its documentation suggests

Added test.

* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateWriter.cpp:
(WebCore::MediaRecorderPrivateWriter::close):
* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateWriter.h:
* 
Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterAVFObjC.h:
* 
Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterAVFObjC.mm:
(WebCore::MediaRecorderPrivateWriterAVFObjC::MediaRecorderPrivateWriterAVFObjC):
(WebCore::MediaRecorderPrivateWriterAVFObjC::writeFrame):
(WebCore::MediaRecorderPrivateWriterAVFObjC::close):
* 
Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterWebM.cpp:
(WebCore::MediaRecorderPrivateWriterWebM::close):
* Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterWebM.h:

Canonical link: https://commits.webkit.org/300824@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to