⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 264773 in webkit


Ignore:
Timestamp:
Jul 23, 2020, 10:22:02 AM (6 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r264742. rdar://problem/65995985

[Cocoa|WebM] Decode error when seeking
​https://bugs.webkit.org/show_bug.cgi?id=214666

Reviewed by Eric Carlson.

A decoder error is hit when seeking because we think all samples coming out of the SourceBufferParserWebM are sync-samples.
This is because the attachment added with CMSetAttachment() is ignored; the correct way to set sample attachments is by
getting the sample attachments array with CMSampleBufferGetSampleAttachmentsArray(), and then iterating over the attachments
and adding keys to the underlying mutable CFDictionary.

  • platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::OnFrame):

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@264742 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-610.1.23.1-branch/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610.1.23.1-branch/Source/WebCore/ChangeLog

    r264708 r264773  
     12020-07-23  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r264742. rdar://problem/65995985
     4
     5    [Cocoa|WebM] Decode error when seeking
     6    https://bugs.webkit.org/show_bug.cgi?id=214666
     7   
     8    Reviewed by Eric Carlson.
     9   
     10    A decoder error is hit when seeking because we think all samples coming out of the SourceBufferParserWebM are sync-samples.
     11    This is because the attachment added with CMSetAttachment() is ignored; the correct way to set sample attachments is by
     12    getting the sample attachments array with CMSampleBufferGetSampleAttachmentsArray(), and then iterating over the attachments
     13    and adding keys to the underlying mutable CFDictionary.
     14   
     15    * platform/graphics/cocoa/SourceBufferParserWebM.cpp:
     16    (WebCore::SourceBufferParserWebM::OnFrame):
     17   
     18   
     19    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     20
     21    2020-07-22  Jer Noble  <jer.noble@apple.com>
     22
     23            [Cocoa|WebM] Decode error when seeking
     24            https://bugs.webkit.org/show_bug.cgi?id=214666
     25
     26            Reviewed by Eric Carlson.
     27
     28            A decoder error is hit when seeking because we think all samples coming out of the SourceBufferParserWebM are sync-samples.
     29            This is because the attachment added with CMSetAttachment() is ignored; the correct way to set sample attachments is by
     30            getting the sample attachments array with CMSampleBufferGetSampleAttachmentsArray(), and then iterating over the attachments
     31            and adding keys to the underlying mutable CFDictionary.
     32
     33            * platform/graphics/cocoa/SourceBufferParserWebM.cpp:
     34            (WebCore::SourceBufferParserWebM::OnFrame):
     35
    1362020-07-22  Alan Coon  <alancoon@apple.com>
    237
  • branches/safari-610.1.23.1-branch/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp

    r264708 r264773  
    4343#include <wtf/Deque.h>
    4444#include <wtf/NeverDestroyed.h>
     45#include <wtf/cf/TypeCastsCF.h>
    4546#include <wtf/darwin/WeakLinking.h>
    4647
    … …  
    794795        trackData->currentBlockBufferPosition = 0;
    795796
    796         if (!isSync)
    797             CMSetAttachment(sampleBuffer.get(), kCMSampleAttachmentKey_NotSync, kCFBooleanTrue, kCMAttachmentMode_ShouldPropagate);
     797        if (!isSync) {
     798            auto attachmentsArray = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer.get(), true);
     799            ASSERT(attachmentsArray);
     800            if (!attachmentsArray)
     801                return Skip(reader, bytesRemaining);
     802            for (CFIndex i = 0, count = CFArrayGetCount(attachmentsArray); i < count; ++i) {
     803                CFMutableDictionaryRef attachments = checked_cf_cast<CFMutableDictionaryRef>(CFArrayGetValueAtIndex(attachmentsArray, i));
     804                CFDictionarySetValue(attachments, kCMSampleAttachmentKey_NotSync, kCFBooleanTrue);
     805            }
     806        }
    798807
    799808        auto trackID = track.track_uid.value();
Note: See TracChangeset for help on using the changeset viewer.