[DVDnav-discuss] [PATCH] Fix playback of DVDs with menu broken by revision 1245

Erik Auerswald auerswal at unix-ag.uni-kl.de
Sat Jan 26 17:46:06 CET 2013


Hi,

svn revision 1245 broke playback of DVDs _with_ menu by incorrectly 
translating an assertion into an early return:

---[cut here]---
$ svn log -r1244:1245
------------------------------------------------------------------------
r1245 | rathann | 2012-12-09 22:13:14 +0100 (Sun, 09 Dec 2012) | 4 lines

Fix failed assertion when there's no menu.

Patch by Erik Hovland.

------------------------------------------------------------------------
$ svn diff -r1244:1245
Index: vm/vm.c
===================================================================
--- vm/vm.c     (revision 1244)
+++ vm/vm.c     (revision 1245)
@@ -1762,7 +1762,8 @@
    pgcit_t *pgcit;

    pgcit = get_PGCIT(vm);
-  assert(pgcit != NULL);  /* ?? Make this return -1 instead */
+  if (pgcit != NULL)
+    return 0;

    if(pgcN < 1 || pgcN > pgcit->nr_of_pgci_srp) {
  #ifdef TRACE
---[cut here]---

To return early if the assertion fails would be

---[cut here]---
Index: vm/vm.c
===================================================================
--- vm/vm.c     (revision 1250)
+++ vm/vm.c     (working copy)
@@ -1762,7 +1762,7 @@
    pgcit_t *pgcit;

    pgcit = get_PGCIT(vm);
-  if (pgcit != NULL)
+  if (pgcit == NULL)
      return 0;

    if(pgcN < 1 || pgcN > pgcit->nr_of_pgci_srp) {
---[cut here]---

This simple change restores playback of DVDs containing a menu.

The current code skips the actual functionality of vm.c::set_PGCN() if 
the call to vm.c::get_PGCIT() was successful!

There were quite a few bug reports about MPlayer (svn version) dvdnav:// 
playback being broken, see this MPlayer-users thread:

http://lists.mplayerhq.hu/pipermail/mplayer-users/2013-January/085825.html

My patch (inline above, attached as well) fixes this regression (tested 
with current MPlayer from svn) and fits the commit log of revision 1245.

Please consider applying.

Thanks,
Erik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libdvdnav-fix_playback_of_DVD_with_menu.patch
Type: text/x-diff
Size: 318 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/dvdnav-discuss/attachments/20130126/b1e6204c/attachment.bin>


More information about the DVDnav-discuss mailing list