-
Notifications
You must be signed in to change notification settings - Fork 1.8k
REGRESSION(299318@main): [GStreamer][MSE] Audio playback broken on instagram #51805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
EWS run on previous version of this PR (hash def6a96) Details |
|
EWS run on previous version of this PR (hash 689f0a6) Details |
|
EWS run on previous version of this PR (hash 796d2cb) Details |
ntrrgc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from what I commented, LGTM.
There is one case of explicit signalling we're not handling here: Backwards-compatible signalling. In that case, AOT=2 appears first, and the SBR and PS extensions appear later in the codec-data. It's a bit trickier to parse because it requires parsing GASpecificInfo as well. For now we can let it be, and if we actually encounter a file where that is a problem, handle it then.
Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp
Outdated
Show resolved
Hide resolved
Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp
Outdated
Show resolved
Hide resolved
Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp
Outdated
Show resolved
Hide resolved
|
EWS run on previous version of this PR (hash e9a9902) Details |
ntrrgc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits.
| if (!result) | ||
| break; | ||
|
|
||
| gst_pad_add_probe(demuxerSrcPad.get(), GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, reinterpret_cast<GstPadProbeCallback>(+[]([[maybe_unused]] GstPad* pad, GstPadProbeInfo* info, gpointer) -> GstPadProbeReturn { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this is too big of a lambda and would be better off as a separate static function. You could call it aacSbrForceImplicitSignalling or something of the like.
|
|
||
| GST_DEBUG_OBJECT(pad, "AAC SBR or PS object type detected in codec data, replacing it with a LC object type. The decoder should be able to handle this properly"); | ||
|
|
||
| auto channels = gst_codec_utils_aac_get_channels(data.data(), data.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was concerned that gst_codec_utils_aac_get_channels() could be too high level and actually parse PS as well, but it doesn't. So as long as it is not changed afterwards, this would work.
Personally I would have just read the bits myself since it's not more difficult than reading the frequency bits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I think we can consider that pbutils API behaviour stable, its doc clearly implies the value return should conform with the spec.
|
|
||
| GRefPtr<GstBuffer> codecDataBuffer; | ||
| gst_structure_get(structure, "codec_data", GST_TYPE_BUFFER, &codecDataBuffer.outPtr(), nullptr); | ||
| GstMappedBuffer data(codecDataBuffer, GST_MAP_READ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also return early with GST_PAD_PROBE_OK and a warning if the length of codec_data < 2, since otherwise the only length checks are asserts, which are not compiled in release.
|
The EWS caught an assertion being broken in STDERR: ASSERTION FAILED: mediaType == "audio/mpeg"_s |
|
EWS run on current version of this PR (hash 4fb454f) Details |
ntrrgc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+
…stagram https://bugs.webkit.org/show_bug.cgi?id=299252 Reviewed by Alicia Boya Garcia. 299318@main introduced a performance regression and also broke Instagram stories audio playback. Instead of forcing ADTS framing we now rewrite the codec_data supplied by the demuxer only if the underlying AAC audio_object_type was set to SBR or PS, which the avdec_aac decoder doesn't handle very well. When any of those object types is detected, we replace it with an LC (Low Complexity) identifier and re-use the existing sampling frequency and channels bits from the previous codec_data. avdec_aac handles LC well and there is no noticeable rendering issue on Kaltura and Instagram stories anymore. Thanks to Alicia Boya Garcia <aboya@igalia.com> for her precious help during the investigation. * Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::aacGetAudioObjectType): (WebCore::createOptionalParserForFormat): Canonical link: https://commits.webkit.org/301209@main
4fb454f to
4a3ebdf
Compare
|
Committed 301209@main (4a3ebdf): https://commits.webkit.org/301209@main Reviewed commits have been landed. Closing PR #51805 and removing active labels. |
|
Backported into |
4a3ebdf
4fb454f
🧪 win-tests🧪 mac-AS-debug-wk2