There could be a race between main thread (linking typefind element, see gsturisourcebin.c:setup_typefind) and streaming thread (pushing data). webKitMediaSrcLoop does wait for source pad to linked. However, there is no guaranty that peer pad is already active at that point. Which may lead to data loss while peer pad is being activated.
The issue can be reproduced with https://emutavchi.github.io/tests/mse/mse_data_loss_test.html. Run browser with extra logging: 'GST_DEBUG=webkitmediaplayer:6,webkitmediasrc:7,GST_SCHEDULING:6,typefind:5,2', and watch the logs. After several runs you should see instances of webkitmediasrc silently dropping buffers:
There could be a race between main thread (linking typefind element, see gsturisourcebin.c:setup_typefind) and streaming thread (pushing data). webKitMediaSrcLoop does wait for source pad to linked. However, there is no guaranty that peer pad is already active at that point. Which may lead to data loss while peer pad is being activated.
The issue can be reproduced with https://emutavchi.github.io/tests/mse/mse_data_loss_test.html. Run browser with extra logging: 'GST_DEBUG=webkitmediaplayer:6,webkitmediasrc:7,GST_SCHEDULING:6,typefind:5,2', and watch the logs. After several runs you should see instances of webkitmediasrc silently dropping buffers:
This change adds a data prob that blocks downstream flow during pad exposure, allowing urisourcebin to link/activate typefind sink pad.