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 659432 - TimeSeekRange npt=0- not supported
TimeSeekRange npt=0- not supported
Status: RESOLVED DUPLICATE of bug 674736
Product: rygel
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Jens Georg
rygel-maint
Depends on:
Blocks:
 
 
Reported: 2011-09-19 03:34 UTC by brumikey
Modified: 2013-03-10 11:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
config (4.18 KB, application/octet-stream)
2011-10-05 15:46 UTC, brumikey
  Details
Preliminary patch fixing npt=0- issue. (1.16 KB, patch)
2011-10-26 14:22 UTC, Krzesimir Nowak
needs-work Details | Review
Generated C file with patch applied. (77.19 KB, text/x-csrc)
2011-10-29 09:30 UTC, Jens Georg
  Details
Preliminary patch fixing npt=0- issue, 2 (1.16 KB, patch)
2011-10-31 15:48 UTC, Krzesimir Nowak
needs-work Details | Review
Preliminary patch fixing npt=0- issue, v3 (1.17 KB, patch)
2011-11-21 13:25 UTC, Krzesimir Nowak
committed Details | Review

Description brumikey 2011-09-19 03:34:37 UTC
I am getting the following error (captured with WireShark) when I try
to stream the gstreamer video test source to my TV:

GET /GstLaunch/i/dmlkZW90ZXN0c3Jj/tr/MPEG_TS_SD_EU_ISO HTTP/1.1
Connection: Close
Host: 192.168.0.3:39702
User-Agent: DLNADOC/1.50 SHARP-AQUOS-DMP/1.1W
getcontentFeatures.dlna.org: 1
transferMode.dlna.org: Streaming
TimeSeekRange.dlna.org: npt=0-

HTTP/1.1 406 Not Acceptable
Date: Sun, 18 Sep 2011 20:00:32 GMT
Content-Length: 0


And the associated console error message:

(rygel:23940): Rygel-WARNING **: rygel-http-request.vala:90: Invalid
seek request
Comment 1 Jens Georg 2011-10-04 14:32:34 UTC
That's interesting, according to the tests this is supported.
Comment 2 brumikey 2011-10-05 13:48:23 UTC
I think the issue comes in rygel-http-get.vala:

    private async void handle_item_request () throws Error {
        var need_time_seek = HTTPTimeSeek.needed (this);
        var need_byte_seek = HTTPByteSeek.needed (this);

        if ((HTTPTimeSeek.requested (this) && !need_time_seek) ||
            (HTTPByteSeek.requested (this) && !need_byte_seek)) {
            throw new HTTPRequestError.UNACCEPTABLE ("Invalid seek request");
        }

HTTPTimeSeek.needed (this) would be false, I assume, perhaps because this is a video item?

    public static bool needed (HTTPGet request) {
        return request.item is AudioItem &&
               (request.item as AudioItem).duration > 0 &&
               (request.handler is HTTPTranscodeHandler ||
                (request.thumbnail == null &&
                 request.subtitle == null &&
                 request.item.is_live_stream ()));
    }

The test code only attempts an audio item, not video.
Comment 3 Jens Georg 2011-10-05 15:20:46 UTC
No, VideoItem is derived from AudioItem. It might be special to the GstPlugin though in a way that we currently can't know if it's Audio or Video and just treat it as an generic item.
Comment 4 brumikey 2011-10-05 15:24:07 UTC
An audio test source does work, last I tried.
Comment 5 Jens Georg 2011-10-05 15:29:46 UTC
Can you paste the config you're using?
Comment 6 brumikey 2011-10-05 15:35:55 UTC
I've been grabbing packages off of http://packages.debian.org/experimental/rygel because I haven't been able to get all the dependencies to build yet.

So, unfortunately it's difficult for me to build, otherwise I'd hack on it.

How about these suspect lines in the video item constructor that aren't in the audio item?

        this.thumbnails = new ArrayList<Thumbnail> ();
        this.subtitles = new ArrayList<Subtitle> ();

Unless request.handler is HTTPTranscodeHandler, this could cause the failure.
Comment 7 brumikey 2011-10-05 15:46:34 UTC
Created attachment 198350 [details]
config
Comment 8 Jens Georg 2011-10-05 15:58:34 UTC
Ah. It doesn't have a duration. We need to special-case that "give me everything" here then.
Comment 9 Krzesimir Nowak 2011-10-26 14:22:17 UTC
Created attachment 200023 [details] [review]
Preliminary patch fixing npt=0- issue.

Should ntp=0- be treated as no seek request at all? If so, attached patch does it, but only for time seek requests. I haven't touched byte seek requests.
Comment 10 Jens Georg 2011-10-29 09:30:00 UTC
Created attachment 200239 [details]
Generated C file with patch applied.

(In reply to comment #9)
> Created an attachment (id=200023) [details] [review]
> Preliminary patch fixing npt=0- issue.
> 
> Should ntp=0- be treated as no seek request at all? If so, attached patch does
> it, but only for time seek requests. I haven't touched byte seek requests.

You have to since we need to add something like

(rygel:20961): Rygel-DEBUG: rygel-http-get.vala:166: TimeSeekRange.dlna.org : npt=0.000-6839.999/6840.000

in the response when know the duration. But we still do that apparently. :)

Original reporter: Does it work for you when you replace the attached C file?
Comment 11 Jens Georg 2011-10-29 09:37:03 UTC
Review of attachment 200023 [details] [review]:

First line of the commit message is too long

::: src/rygel/rygel-http-time-seek.vala
@@ +100,2 @@
     public static bool requested (HTTPGet request) {
+        string? seek_request = request.msg.request_headers.get_one ("TimeSeekRange.dlna.org");

a) Line is too long (>80 chars)
b) no need for nullable string here, you mainly need them for parameters and as a hint in return values; also use "var", see https://live.gnome.org/Rygel/CodingStyle (I forgot to give you that link previously, sorry).

@@ +103,3 @@
+        if (seek_request != null)
+        {
+            return seek_request != "npt=0-";

Strictly speaking whitespace is not allowed in "npt.." but I wonder if we should ignore them for the sake of interoperability
Comment 12 Krzesimir Nowak 2011-10-31 15:48:46 UTC
Created attachment 200345 [details] [review]
Preliminary patch fixing npt=0- issue, 2

Updated coding style.
Comment 13 brumikey 2011-11-01 02:04:40 UTC
I will check it out and see.  It will be a few days before I can look at it.
Comment 14 brumikey 2011-11-04 03:17:08 UTC
Well now I'm confused.  Granted it's been over a month since I reported the issue, and my TV's software rev hasn't changed, but I'm having trouble getting my TV to request a time seek!  It has done it a few times tonight, but has never been repeatable.  The videotestsrc is just working right now!

With that said, the proposed patch does not work.  It trips up the case where there is no time seek header and causes it to fail.  Something more like 

return seek_request != null && seek_request != "npt=0-";

would fix that.  I'll keep testing and see if I can get it to fail, not sure how long that will take...
Comment 15 Jens Georg 2011-11-16 13:18:44 UTC
Review of attachment 200345 [details] [review]:

::: src/rygel/rygel-http-time-seek.vala
@@ +102,3 @@
+                                        ("TimeSeekRange.dlna.org");
+
+        return seek_request != "npt=0-";

Ok now, apart from the fact that the check for != null is missing now.
Comment 16 Krzesimir Nowak 2011-11-21 13:25:07 UTC
Created attachment 201807 [details] [review]
Preliminary patch fixing npt=0- issue, v3

Yes, I was confused a bit about those nullable types.
Comment 17 Jens Georg 2011-12-23 21:35:41 UTC
Pushed with minor formatting fixes
Comment 18 Jens Georg 2012-03-17 16:57:44 UTC
We need to find another solution for this, this breaks DLNA test 7.3.33.4
Comment 19 Jens Georg 2012-03-21 08:07:07 UTC
Additionally VLC likes to request resources with "bytes=0-" so we need to gracefully handle that as well.
Comment 20 Jens Georg 2012-04-26 18:23:44 UTC
*** Bug 671193 has been marked as a duplicate of this bug. ***
Comment 21 Jens Georg 2013-03-10 11:51:16 UTC

*** This bug has been marked as a duplicate of bug 674736 ***