After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765528 - gstmpdparser: GstUri changed unexpectedly within combine_urls()
gstmpdparser: GstUri changed unexpectedly within combine_urls()
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Windows
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-25 11:21 UTC by WeiChungChang
Modified: 2018-11-03 13:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
issued MPD file (20.50 KB, application/xml)
2016-04-25 11:21 UTC, WeiChungChang
  Details
mpdparser: Copy over already existing query strings when combining URLs (1.48 KB, patch)
2016-05-02 08:41 UTC, Sebastian Dröge (slomo)
none Details | Review
patch to resolve this issue (1.20 KB, patch)
2016-05-03 07:15 UTC, WeiChungChang
needs-work Details | Review
MPD file where issue happened (20.50 KB, application/xml)
2016-05-03 07:18 UTC, WeiChungChang
  Details
tests: dash_mpd: test for urls with query parameters (2.87 KB, patch)
2016-05-05 17:06 UTC, Thiago Sousa Santos
none Details | Review
Resolve the issue if queryURL appears when downloading index or initialization segment. (1.28 KB, patch)
2016-05-29 05:30 UTC, WeiChungChang
needs-work Details | Review

Description WeiChungChang 2016-04-25 11:21:20 UTC
Created attachment 326680 [details]
issued MPD file

Hi all:
 
I met a problem when combine_urls() is executed the result URL is broken.
 
Such as:
 
expected result =
"https://r8---sn-ipoxu-u2xl.googlevideo.com/videoplayback?id=cf12500690581ecb&itag=133&source=youtube&requiressl=yes&ms=au&pl=16&mm=31&mv=m&mn=sn-ipoxu-u2xl&initcwndbps=1245000&ratebypass=yes&mime=video/mp4&gir=yes&clen=3617089&lmt=1439380361025617&dur=121.746&signature=8C0600A08A8FA47C3734F42B4721E2143EACDF94.705D52170E63A2E70291789D67FAC9C139B12965&mt=1461557621&upn=hP1NJs1_Lng&sver=3&fexp=3300118,3300134,3300161,3312381,9410705,9416126,9416891,9422596,9426927,9427482,9428398,9431012,9431364,9431865,9432033,9432132,9432684,9432839,9433096,9433193,9433425,9433947,9433997&key=dg_yt0&ip=42.73.160.27&ipbits=0&expire=1461579370&sparams=ip,ipbits,expire,id,itag,source,requiressl,ms,pl,mm,mv,mn,initcwndbps,ratebypass,mime,gir,clen,lmt,dur <https://r8---sn-ipoxu-u2xl.googlevideo.com/videoplayback?id=cf12500690581ecb&itag=133&source=youtube&requiressl=yes&ms=au&pl=16&mm=31&mv=m&mn=sn-ipoxu-u2xl&initcwndbps=1245000&ratebypass=yes&mime=video/mp4&gir=yes&clen=3617089&lmt=1439380361025617&dur=121.746&signature=8C0600A08A8FA47C3734F42B4721E2143EACDF94.705D52170E63A2E70291789D67FAC9C139B12965&mt=1461557621&upn=hP1NJs1_Lng&sver=3&fexp=3300118%2c3300134%2c3300161%2c3312381%2c9410705%2c9416126%2c9416891%2c9422596%2c9426927%2c9427482%2c9428398%2c9431012%2c9431364%2c9431865%2c9432033%2c9432132%2c9432684%2c9432839%2c9433096%2c9433193%2c9433425%2c9433947%2c9433997&key=dg_yt0&ip=42.73.160.27&ipbits=0&expire=1461579370&sparams=ip%2cipbits%2cexpire%2cid%2citag%2csource%2crequiressl%2cms%2cpl%2cmm%2cmv%2cmn%2cinitcwndbps%2cratebypass%2cmime%2cgir%2cclen%2clmt%2cdur>
"
 
broken result =  "https://r8---sn-ipoxu-u2xl.googlevideo.com/videoplayback
"
 
 
static GstUri *
combine_urls (GstUri * base, GList * list, gchar ** query,
    GstActiveStream * stream)
{
 
  GstUri *ret = base;
  ...
 
  /*here the ret is still sound*/
 
  gst_uri_set_query_table (ret, NULL);
 
  /*here the ret is broken...*/
 
}
 
 
 
The attached is the DASH MPD where this issue happened.
 
Could someone help on checking it?
 
Thanks.
Comment 1 Sebastian Dröge (slomo) 2016-05-02 08:41:39 UTC
Can you provide a simple testcase for this, by adding something to gst-plugins-bad/tests/check/elements/dash_mpd.c?

combine_urls() is setting the queries to NULL, but that is expected. The query part is returned and supposed to be used by the caller. Not happening everywhere and the attached patch probably fixes it. Can you confirm?
Comment 2 Sebastian Dröge (slomo) 2016-05-02 08:41:57 UTC
Created attachment 327135 [details] [review]
mpdparser: Copy over already existing query strings when combining URLs
Comment 3 WeiChungChang 2016-05-03 07:14:23 UTC
Dear slomo:

I have tried your patch but failed..

After doing some checks, I found the issue happened when downloading index or header segment. It does NOT assemble queryURL & baseURL in this case so the issue happened. 

I made a patch as attached as well as the MPD file which leads to the issue.

Please kindly refer to it.

Thank you~
Comment 4 WeiChungChang 2016-05-03 07:15:52 UTC
Created attachment 327196 [details] [review]
patch to resolve this issue

patch to resolve this issue
Comment 5 WeiChungChang 2016-05-03 07:18:46 UTC
Created attachment 327197 [details]
MPD file where issue happened

MPD file where issue happened
Comment 6 Sebastian Dröge (slomo) 2016-05-03 07:20:21 UTC
Is your patch needed on top of mine, or is yours alone enough?
Comment 7 WeiChungChang 2016-05-03 12:46:01 UTC
Dear slomo:

It is only with 2nd patch.

I think the root cause is the same procedure should be applied to index & header segment also.

Otherewise, once the query strings appear their URL will be wronglyt truncated & an invalid URL will lead to request fail.

I am not so experienced in handling URL so please kindly give it a review. 

Thank you!
Comment 8 Thiago Sousa Santos 2016-05-05 13:58:21 UTC
Review of attachment 327196 [details] [review]:

Thanks for the patch, a few things  to fix.

Also please follow our commit message style, check git log to see other commits for reference. And add a valid author/email to the patch.

::: ext/dash/gstmpdparser.c
@@ +3076,3 @@
   g_return_val_if_fail (stream != NULL, NULL);
 
+  if (!InitializationURL->sourceURL) {

InitializationURL might be NULL, causing a segfault here.
Comment 9 Thiago Sousa Santos 2016-05-05 17:06:12 UTC
Created attachment 327359 [details] [review]
tests: dash_mpd: test for urls with query parameters

This test depicts the problem and also shows that the propsed patch segfaults
Comment 10 WeiChungChang 2016-05-29 05:30:05 UTC
Created attachment 328685 [details] [review]
Resolve the issue if queryURL appears when downloading index or initialization segment.

Resolve the issue if queryURL appears when downloading index or initialization segment
Comment 11 WeiChungChang 2016-05-29 05:35:55 UTC
Dear Thiago:

As according to your suggestion, a new patch has been sent.

Thank you.
Comment 12 Thiago Sousa Santos 2016-05-30 21:06:48 UTC
Review of attachment 328685 [details] [review]:

Code looks ok, but please provide a better commit message. Just check git log of any module and you will see how to properly format the message.

Also, do you know which part of the spec mentions how these URL parameters should be copied around? Couldn't find anything specific about this.
Comment 13 Sebastian Dröge (slomo) 2016-07-01 12:33:32 UTC
John, can you update your patch?
Comment 14 GStreamer system administrator 2018-11-03 13:49:53 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/380.