GNOME Bugzilla – Bug 539254
[dvdreadsrc] DVDs with multiple angles switch angles during read
Last modified: 2010-11-13 12:43:32 UTC
Please describe the problem: When reading a DVD with multiple angles, the angle will sometimes switch to a different angle. Steps to reproduce: 1. Get a DVD with more than one angle 2. use dvdreadsrc to read it (eg, use Thoggen) 3. If you're unlucky, watch how the angle switches to another one Actual results: You get a movie with interleaved angles - quite annoying when one angle is the movie and the other is a storyboard version Expected results: The reading keeps to the selected angle Does this happen every time? 100% repro on a couple test cases, but may or may not happen on other DVDs with multiple angles Other information:
Created attachment 113108 [details] [review] This fixes the problem on my test cases I left the original code for easy comparison, as I have no idea if this is correct, though it works 100% for me. I do not know where is the doc describing how the blocks and their types are arranged. But it fixes my test cases and makes me happy, so that's good :)
Created attachment 130255 [details] [review] fix code to compute next block to read from the correct angle (Update to latest git) I somehow managed to encode a new DVD with the stock version of the dvdread plugin, so I had to reapply this patch. In case someone here somehow might want to push it up the tree, here it is again, as git against latest. It just happens to work for me, I make no representations about the conceptual correctness of it, but it scratches my itch.
I can reproduce this with my Nausicaa DVD. As reported, sometimes the wrong cell is returned and you end up watching the story-board instead, e.g. chapter 12 contains two cells (27 and 28) and it will always play cell 28 after finishing 27 instead of skipping over it and on to the next chapter (Cell 28 is the story-board). It seems to me that the logic of the while loop should be reversed, i.e. it should keep incrementing the current cell _until_ it finds a BLOCK_MODE_LAST_CELL, and then add one to get the next cell. This certainly seems to be how it is implemented in play_title.c (distributed with libdvdread): for( i = 0;; ++i ) { if( cur_pgc->cell_playback[ cur_cell + i ].block_mode == BLOCK_MODE_LAST_CELL ) { next_cell = cur_cell + i + 1; break; } } Very different, compared to how dvdreadsrc implements it: while (pgc->cell_playback[cell].block_mode == BLOCK_MODE_LAST_CELL) ++cell; return cell + 1; Simply changing the condition in the while loop from == to != seems to fix this for me. It seems to happily play through with either angle 1 or 2 now with no switching back and forth.
Created attachment 173956 [details] [review] Trivial patch to fix DVD angles This issue can be reproduced so easily (any DVD with multiple angles) and the fix is so small; hopefully the attached patch will help to get this confirmed and/or committed.
Thanks for the patch! commit c29b56fae9c52f90569e24da42b9c4b95405b059 Author: Thomas Green <thomasgr33n@gmail.com> Date: Sat Nov 13 12:34:37 2010 +0000 dvdreadsrc: fix handling of multi-angle streams We would output all angles interleaved instead of just the selected angle. https://bugzilla.gnome.org/show_bug.cgi?id=539254 Sorry it took so long to get this fixed.