Skip to content

Commit

Permalink
[GStreamer] Invalid command line error when visiting www.chessbase.com
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=124715

Reviewed by Philippe Normand.

Source/WebCore:

We were not handling the HTTP errors in the WebKit GStreamer
source and therefore the 404 error page was being 'decoded'. As no
decoder could be found (for obvious reasons), playback failed, but
it should be failing for the source not being found instead of the
decoding problem.

Test: http/tests/media/video-error-does-not-exist.html

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(StreamingClient::handleResponseReceived): Handle HTTP errors in
the source and raise a GStreamer error to the pipeline.

LayoutTests:

Copied and adapted for HTTP from
media/video-error-does-not-exist.html.

* http/tests/media/video-error-does-not-exist-expected.txt: Added.
* http/tests/media/video-error-does-not-exist.html: Added.


Canonical link: https://commits.webkit.org/143061@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
calvaris committed Nov 27, 2013
1 parent 62bc1b6 commit aca899f
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 0 deletions.
13 changes: 13 additions & 0 deletions LayoutTests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2013-11-27 Xabier Rodriguez Calvar <calvaris@igalia.com>

[GStreamer] Invalid command line error when visiting www.chessbase.com
https://bugs.webkit.org/show_bug.cgi?id=124715

Reviewed by Philippe Normand.

Copied and adapted for HTTP from
media/video-error-does-not-exist.html.

* http/tests/media/video-error-does-not-exist-expected.txt: Added.
* http/tests/media/video-error-does-not-exist.html: Added.

2013-11-14 Sergio Villar Senin <svillar@igalia.com>

[CSS Grid Layout] Fix positioning of grid items with margins
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Test that the media element is in correct state after load fails from HTTP.



EXPECTED (video.error == 'null') OK

EVENT(error)
EXPECTED (video.error != 'null') OK
EXPECTED (video.error.code == '4') OK
EXPECTED (video.networkState == '3') OK
EXPECTED (isNaN(video.duration) == 'true') OK
EXPECTED (video.currentTime == '0') OK
EXPECTED (video.buffered.length == '0') OK
EXPECTED (video.seekable.length == '0') OK
EXPECTED (video.buffered.length == '0') OK
END OF TEST

28 changes: 28 additions & 0 deletions LayoutTests/http/tests/media/video-error-does-not-exist.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<p>Test that the media element is in correct state after load fails from HTTP.</p>
<video controls></video>
<script src=../../media-resources/video-test.js></script>
<script src=../../media-resources/media-file.js></script>
<script>

consoleWrite("");
testExpected("video.error", null);

waitForEventAndTest("canplaythrough", "false");

waitForEvent("error", function () {
testExpected("video.error", null, "!=");
testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);

testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE);

testExpected("isNaN(video.duration)", true);
testExpected("video.currentTime", 0);
testExpected("video.buffered.length", 0);
testExpected("video.seekable.length", 0);
testExpected("video.buffered.length", 0);
endTest();
});

video.src = "http://127.0.0.1:8000/does-not-exist.mpeg";
consoleWrite("");
</script>
19 changes: 19 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
2013-11-27 Xabier Rodriguez Calvar <calvaris@igalia.com>

[GStreamer] Invalid command line error when visiting www.chessbase.com
https://bugs.webkit.org/show_bug.cgi?id=124715

Reviewed by Philippe Normand.

We were not handling the HTTP errors in the WebKit GStreamer
source and therefore the 404 error page was being 'decoded'. As no
decoder could be found (for obvious reasons), playback failed, but
it should be failing for the source not being found instead of the
decoding problem.

Test: http/tests/media/video-error-does-not-exist.html

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(StreamingClient::handleResponseReceived): Handle HTTP errors in
the source and raise a GStreamer error to the pipeline.

2013-11-14 Sergio Villar Senin <svillar@igalia.com>

[CSS Grid Layout] Fix positioning of grid items with margins
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,14 @@ void StreamingClient::handleResponseReceived(const ResourceResponse& response)

GST_DEBUG_OBJECT(src, "Received response: %d", response.httpStatusCode());

if (response.httpStatusCode() >= 400) {
// Received error code
GST_ELEMENT_ERROR(src, RESOURCE, READ, ("Received %d HTTP error code", response.httpStatusCode()), (0));
gst_app_src_end_of_stream(priv->appsrc);
webKitWebSrcStop(src);
return;
}

GMutexLocker locker(GST_OBJECT_GET_LOCK(src));

if (priv->seekID) {
Expand Down

0 comments on commit aca899f

Please sign in to comment.