My favorites | Sign in
Project Home Downloads Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 822: [Patch] Partial-content (byte range) content size bug
9 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Closed:  Dec 2011

Sign in to add a comment
Reported by, Aug 14, 2010
What steps will reproduce the problem?
1. Attach a BDP-S370 bluray player to the LAN
2. Attempt to use the DLNA media capability with PMS, to play audio or video for instance.

What is the expected output? What do you see instead?
Media is browsable but cannot be played - unsupported format is reported.

What version of the product are you using? On what operating system?
PMS r410, debian 5

If you are transcoding a media file, which engine are you using (mencoder, avisynth/mencoder, tsmuxer?)

If the media file is in error (or does not play flawlessly), what are the codec informations of this file (you can use following program: ?

Please provide any additional information below and PLEASE JOIN debug.log file !!

Aug 14, 2010
Patch to fix this is available at (I couldn't attach it here because the quota is exceeded).
Aug 19, 2010
This is a specific instance of the bug reported by  issue #430 
Sep 29, 2010
Project Member #3
(No comment was entered for this change.)
Status: Started
Owner: shagr4th
Sep 29, 2010
Sorry, wrong issue referred in comment above.  Actually an instance of  issue #830 .  Sorry.
Jan 18, 2011
Project Member #5
 Issue 830  has been merged into this issue.
Jan 18, 2011
Project Member #6
(No comment was entered for this change.)
Summary: [Patch] Partial-content (byte range) content size bug
Feb 7, 2011
New patch for revised trunk (r486+) is available here:
Sep 13, 2011
Yet another attempt to finish this issue.  The 3 patches below (r811) are WoH's patch above and the [ patters] patch refactored to create a formal 'chunked' response mode, plus a separate patch adding support for jpeg thumbs and m2ts on Sony Bluray players, (patches are git-format-patch flavor, apply using 'patch -p1', unix line endings).

Details are at .
7.3 KB   View   Download
8.1 KB   View   Download
16.5 KB   View   Download
6.1 KB   View   Download
Sep 20, 2011
Project Member #9
(No comment was entered for this change.)
Sep 20, 2011
Project Member #10
Patches reviewed and committed in r826.
Status: Fixed
Sep 20, 2011
This patch is already tested in SubJunk build so maybe it was better to commit it with his other patches included in latest SJ builds. Only thought.
Sep 21, 2011
Just for clarification: the original version of the WoH patch (already in SubJunk) fixes direct streaming but not transcoding.  The new patches above rework response headers in to fix transcoding too, which is why that specific part of the original WoH patch is dropped.
Sep 21, 2011
Chunked response mode for http engine V1 + a minor fix to prevent NullPointerException if inputstream is null.
5.5 KB   View   Download
Sep 22, 2011
Project Member #14
(No comment was entered for this change.)
Status: New
Sep 24, 2011
A more thorough fix for NullPointerException has already been applied in r834. Below is the corresponding chunked response mode for http engine V1.
Sep 24, 2011
(No comment was entered for this change.)
6.8 KB   View   Download
Oct 2, 2011
Project Member #17
Thanks for the patch, infidel!
Committed in r854.
Status: Fixed
Oct 4, 2011
Great, just in time for the bugfix!

Over the weekend I was watching a big vob and playback cut off at the 2 gig mark, a consequence it turned out of my patch relying too heavily on inputStream.available() which returns an int, not a long. This bug  only affects chunked mode.

In the process of fixing it I realized that my default mode varied somewhat from the original default mode, so I ended up rewriting the Content-Length/Range logic entirely to bring it in line. I don't have a PS3 or any non-chunking renderer, so it would be good if someone could verify default mode here.

7.4 KB   View   Download
Oct 4, 2011
Project Member #19
(No comment was entered for this change.)
Status: New
Oct 5, 2011
Patch above regenerated for r864+.
Oct 5, 2011
(No comment was entered for this change.)
7.4 KB   View   Download
Oct 8, 2011
Project Member #22
 Issue 1242  has been merged into this issue.
Oct 22, 2011
Project Member #24
Patch committed in r947.
Oct 23, 2011
Unfortunately r826 introduced bug that my Panasonic TV stopped FF/RW native AVI files without transcoding.
This r947 patch didn't fixed it.
Original WoH #822 patch works OK so bug is in some different change made by infidel:-(
Original WoH patch tested and it is not culprit of this behavior:
Thanks for looking into that!
Oct 23, 2011
#26 subjunk
Hope we can get this solved soon
Oct 23, 2011
ExSport, can you please post complete TRACE level debug.logs showing what happens when you FF/RW the same file before (pms-exsport r14) and now (r947) in the discussion thread (

Otherwise "logic" will continue to be my only guide :)

Oct 24, 2011
Hopefully this weekend I will be at home so will test it.
Found out that SubJunk build SB45 works but SB46+ not so bug is somewhere between r821-r841. And r826 was only patch which is relevant.
Will test this SB45 because it includes "my" version of WoH patch but it is more recent so more similar with official build.
Oct 28, 2011
Debug files attached.
I tried it this way:
- play for few secs, then start to fast forward few secs, clicked play again, played few secs and finally stopped it
SB45 works but SB52 not. For consistency I used SB build but SB45 includes same WoH patch as in my build and SB53 includes one from latest official trunk(WoH with some modifications)
Thanks for help...will try to check logs later but I suppose I will not find anything:-)
9.2 KB   Download
Oct 28, 2011
Sorry forgot to say it doesn't work on purely streamed DivX files (Panasonic TV).
When it works it fast forward OK but with broken version it just freezes picture and when FF is stopped it continues to play from last position before FF.
It works for transcoded and remuxed files what I remember,only streamed files doesn't work.
Hope it helps.
Oct 28, 2011
Mea culpa. 15 minutes after first posting ChunkedResponse-fixes-r864.patch I noticed a mistake so I deleted the original attachment and reposted (as you can see above). I should have entered a comment for clarification. The deleted bad patch was applied in r947.  Here's the fix, hopefully solving the Panasonic issues. Thanks for the logs, which made this apparent right away. 
1006 bytes   View   Download
Oct 28, 2011
Digging in the log and found some differences and maybe also DLNA violations.
[New I/O server worker #1-8] TRACE 15:01:29.072 HTTP: get/0$0$0/Test_FF_RW.avi / 0--1
[New I/O server worker #1-8] TRACE 15:01:29.073 Asked stream chunk : TimeRange [start=null, end=null] of Test_FF_RW.avi and player null
[New I/O server worker #1-8] TRACE 15:01:29.074 Sending 743440384 bytes.
[New I/O server worker #1-8] TRACE 15:01:29.076 Sent to socket: Content-Length: 743440384
[New I/O server worker #1-8] TRACE 15:01:29.077 Sent to socket: Content-Range: bytes 0-743440383/743440384
In code I found that there is two behaviors for "Content-Length" so I added this to Panasonic.conf:
ChunkedTransfer = true

Now FF/RW works :-)
Maybe this should be enabled by default(when not defined). Now it works in opposite. I saw it only for PS3 that it is disabled but don't know other renderers.
Oct 28, 2011
About the r947. I think in this commit already fixed ChunkedResponse-fixes-r864.patch was applied or not?
Old buggy one was committed in r826 so I thought fixed one was in r947.
But definitely "ChunkedTransfer = true" fixed FF/RW.
So it is needed this new one? "ChunkedResponse-fixes2.patch"
Oct 28, 2011
ChunkedResponse-fixes2.patch can be applied against current trunk, it's a fix for r947+. No need to reverse any patches.

Chunked and 'normal' response are nearly identical now, I suspected that other renderers wouldn't have a problem with chunked.  Someone should try it on a PS3.

Oct 28, 2011
Exsport, just to clarify:

Yes, ChunkedResponse-fixes2.patch is still needed because without it 'normal' mode still has the FF/RW problem.  Once it's been applied then your Panasonic should work both in chunked and normal modes.

If others would experiment with setting ChunkedTransfer=true for their renderers, we'd know whether chunked can become the default.

EDIT: typo

Oct 28, 2011
To whoever asked to testing this to PS3.  I have been messing with this for a few hours now.
Added ChunkedTransfer = true to PMS.conf 

Tested full transcode (Fast Five w/subs and DTS 'kept in stream':
FF and RW up to 120 X , back and forth random start and stops.  Had zero problems with A/V sync.

Tested remux (Prince of Persia w/ DTS 'kept in stream' :
FF and RW up to 120 X , back and forth with random starts and stops.  Zero sync issues.

Still testing with various other files/formats.  Will post further.
Oct 28, 2011
Val, this property have to be added to renderer.conf = ps3.conf, not pms.conf
Oct 28, 2011
Tested ChunkedTransfer = true on PS3 and it works same way like ChunkedTransfer = false.
Will compile new SB version with your latest patch to test it on Panasonic TV with ChunkedTransfer = false (default)
Oct 28, 2011
To add:

I have tried this value entered in PMS.conf as 'true' , but was unaware it was to be added to P3renderer.conf instead so it was still set as 'false' there.

But I still achieved FF'ing and RW'ing full speed while trans/remuxing to my PS3.

If I reverse, and remove the value from PMS.conf and add it instead to the PS3renderer.conf as 'true' I achieve the same results.  FF'ing and RW'ing full speed while trans/remuxing

I am not tech saavy to understand such traits, so I am a little confused.  But either way it seems like my PS3 is able to achieve full speed FF/RW trans/remuxing now.  Very cool.
Oct 28, 2011
You want to say it doesn't worked for you in past?
It worked for me in past with false and also now with true so no difference in behavior:-)
Now I am talking about editing renderer.conf, without applied last fix "ChunkedResponse-fixes2.patch"
Oct 29, 2011
#43 subjunk
Thanks for the latest fix. Committing it now
Oct 29, 2011
Project Member #44
Good! Let's hope r959 solves it!
Oct 29, 2011
Tested on Panasonic TV with "ChunkedTransfer = true/false" and now FF/RW works:-)
Dec 18, 2011
Project Member #46
(No comment was entered for this change.)
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting