[DVDnav-discuss] [PATCH] "dvdnav_jump_to_sector" as an alternative to "dvdnav_time_search" (REV 1: handle delay when reading directly off disc)

Erik Hovland erik at hovland.org
Thu Nov 17 18:18:28 CET 2011


On Wed, Nov 16, 2011 at 9:11 PM, gnosygnu <gnosygnu at gmail.com> wrote:
>> I was just going over the new patch and saw this code:
>> +    /* HACK: ifo->vts_tmapt is NULL
>> +     * get ifo again by calling ifoOpen
>> +     * (ifoOpen will return an ifo with a timeMap)
>> +     * cache this ifo by overwriting this->vm->vtsi */
>> +    if (tmapt == NULL) {
>> +      ifo = ifoOpen(this->vm->dvd, vts_idx);
>> +      this->vm->vtsi = ifo;
>> +      tmapt = ifo->vts_tmapt;
>> +      if (tmapt == NULL) return NULL;
>> +    }
>>
>> This is probably why there is a #include <dvdread/ifo_read.h>.
> Yup. Exactly. :)
>
>> Any reason why you feel you have to re-open the IFO? It seems like
>> overkill or that you are workaround a bug elsewhere because vts_tmapt
>> is NULL.
> I admit it is overkill. I only did it because the existing ifo's time
> map reference is null. Specifically "this->vm->vtsi->vts_tmapt" was
> null. In contrast the admap pointer was not null:
> "this->vm->vtsi->menu_vobu_admap".
>
> I didn't know why tmap was null but I discovered if I call "ifo =
> ifoOpen(this->vm->dvd, vts_idx);" I get back an ifo with a time map
> reference that was valid.
>
> I admit this was kludgy. I put a note in the code, but I should
> probably have highlighted it better. Please let me know if there's
> another way I can get back a valid time map reference without having
> to reopen the ifo file. I'd be happy to change it.

What about using the already existing ifo handle to re-read the tmap?
int ifoRead_VTS_TMAPT(ifo_handle_t *);

I am still concerned that the vts_tmapt is not already set up.

E

-- 
Erik Hovland
erik at hovland.org
http://hovland.org/


More information about the DVDnav-discuss mailing list