Do you happen to have any extra output from the run? I put a couple of
error messages in there to try to figure out why set_PGCN() is
crapping out.

>> What do these two patches do? It may actually be the right thing to do
>> in this instance, so I am curious what the error messaging patch says
>> without using the return instead of assert patch.
>
>     assertion=assertion@entry=0x7ffff3087b9b "(signed)*pos != -1",
> file=file@entry=0x7ffff3087b8b "src/searching.c", line=line@entry=567,
>     function=function@entry=0x7ffff3087e50 <__PRETTY_FUNCTION__.5455>
> "dvdnav_get_position") at assert.c:92
> #3  0x00007ffff7424552 in __GI___assert_fail
> (assertion=assertion@entry=0x7ffff3087b9b "(signed)*pos != -1",
> file=file@entry=0x7ffff3087b8b "src/searching.c",
>     line=line@entry=567, function=function@entry=0x7ffff3087e50
> <__PRETTY_FUNCTION__.5455> "dvdnav_get_position") at assert.c:101
> #4  0x00007ffff307f7ee in dvdnav_get_position (this=0x7fffc4001110,
>
> If I comment out the assertion on line 567, vlc starts playing the actual
> film, skipping the menu.

The assert on line 567 in searching.c looks a lot more like an assert
should. How about the attached patch? What does it do? It removes the
assert, but it also returns an error message if no position is found.

Thanks

E

-- 
Erik Hovland
[email protected]
http://hovland.org/
diff --git a/src/searching.c b/src/searching.c
index d0a2f80..8c382dd 100644
--- a/src/searching.c
+++ b/src/searching.c
@@ -550,7 +550,7 @@ dvdnav_status_t dvdnav_get_position(dvdnav_t *this, uint32_t *pos,
       last_cell_nr = state->pgc->nr_of_cells;
   }
 
-  *pos = -1;
+  *pos = UINT32_MAX;
   *len = 0;
   for (cell_nr = first_cell_nr; cell_nr <= last_cell_nr; cell_nr++) {
     cell = &(state->pgc->cell_playback[cell_nr-1]);
@@ -564,10 +564,13 @@ dvdnav_status_t dvdnav_get_position(dvdnav_t *this, uint32_t *pos,
     *len += cell->last_sector - cell->first_sector + 1;
   }
 
-  assert((signed)*pos != -1);
-
   pthread_mutex_unlock(&this->vm_lock);
 
+  if (*pos == UINT32_MAX) {
+    printerr("Failed to find position");
+    return DVDNAV_STATUS_ERR;
+  }
+
   return DVDNAV_STATUS_OK;
 }
 
_______________________________________________
DVDnav-discuss mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/dvdnav-discuss

Reply via email to