mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1361984 - Fix the logic of AnnexB::ConvertSampleToAnnexB that checks the sample's extradata field even the sample is AVCC format converted by ConvertSampleToAVCC from AnnexB format. r=jya
MozReview-Commit-ID: C5cAlvRwkYj --HG-- extra : rebase_source : 58e0ea5939446f21395a417ce23ffd2b91f5d83c
This commit is contained in:
parent
3a65ebf0a5
commit
bbc9597929
@ -22,12 +22,12 @@ AnnexB::ConvertSampleToAnnexB(mozilla::MediaRawData* aSample, bool aAddSPS)
|
||||
{
|
||||
MOZ_ASSERT(aSample);
|
||||
|
||||
if (!IsAVCC(aSample)) {
|
||||
if (IsAnnexB(aSample)) {
|
||||
return true;
|
||||
}
|
||||
MOZ_ASSERT(aSample->Data());
|
||||
|
||||
if (!ConvertSampleTo4BytesAVCC(aSample)) {
|
||||
if (IsAVCC(aSample) && !ConvertSampleTo4BytesAVCC(aSample)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ AnnexB::ConvertSampleToAnnexB(mozilla::MediaRawData* aSample, bool aAddSPS)
|
||||
}
|
||||
|
||||
// Prepend the Annex B NAL with SPS and PPS tables to keyframes.
|
||||
if (aAddSPS && aSample->mKeyframe) {
|
||||
if (aAddSPS && aSample->mKeyframe && IsAVCC(aSample)) {
|
||||
RefPtr<MediaByteBuffer> annexB =
|
||||
ConvertExtraDataToAnnexB(aSample->mExtraData);
|
||||
if (!samplewriter->Prepend(annexB->Elements(), annexB->Length())) {
|
||||
|
Loading…
Reference in New Issue
Block a user