Bug 191419 - [MSE][GStreamer] Soundcloud serves MP4 audio with empty tfdt boxes
Summary: [MSE][GStreamer] Soundcloud serves MP4 audio with empty tfdt boxes
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
Depends on:
Reported: 2018-11-08 04:08 PST by Alicia Boya García
Modified: 2021-06-18 09:21 PDT (History)
7 users (show)

See Also:

Patch (3.14 KB, patch)
2021-06-18 06:42 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alicia Boya García 2018-11-08 04:08:33 PST
Soundcloud is currently not working on WebKitGTK, stalling after a few seconds. See for instance:


After a little analysis I found it uses MSE with MP4 audio, but its fragments have all their tfdt's set to zero, which is *super wrong*. This means that it appends audio fragments without telling the browser what part of the timeline they pertain.

But that bears the question, how does it manage to work in other platforms? It works in Chrome and Firefox.

I suspect other browsers may be repairing the file by assuming every fragment has the same duration in cases and multiplying it by the sequence number. This problem can be detected safely because when it is present (tfdt == 0 && sequence_number > 0).
Comment 1 Xabier Rodríguez Calvar 2018-11-08 04:43:03 PST
Eric, Jer, is this working for you? Why?
Comment 2 Michael Catanzaro 2019-09-06 14:27:20 PDT
Comment 3 Alicia Boya García 2019-09-07 03:25:06 PDT
The workaround would likely be in the demuxer, not in WebKit code.
Comment 4 Jer Noble 2019-09-07 14:18:31 PDT
That site is currently serving Safari .mp3s, not mp4s:

> [Debug] MediaSource::addSourceBuffer(B9E70A31) audio/mpeg

That could explain why it's working for Mac ports.
Comment 5 Michael Catanzaro 2019-10-25 06:36:09 PDT
I suggest trying a Mac user agent quirk, then.
Comment 6 Alexander Vereeken 2020-01-01 04:15:06 PST
I found out that soundcloud plays fine by edit the sting /org/gnome/epiphany/web/user-agent with dconf-editor to "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
Comment 7 Alexander Vereeken 2020-01-06 08:17:17 PST
Okay "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0" Seems to be a better workaround because the other one breaks youtube somehow with epiphany.
Comment 8 Philippe Normand 2021-06-18 06:42:39 PDT
Created attachment 431772 [details]
Comment 9 EWS 2021-06-18 09:21:15 PDT
Committed r279039 (238959@main): <https://commits.webkit.org/238959@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431772 [details].