[DVDnav-discuss] dvdnav patches from handbrake project

John Stebbins stebbins at jetheaddev.com
Sat May 29 22:04:51 CEST 2010


On 05/29/2010 10:47 AM, Erik Hovland wrote:
> * nav-dup-handle.patch
>> This patch allows you safely to create a duplicate of a dvdnav_t.  This
>> handle can be used in parallel with the handle it is duplicated from.
>> HandBrake uses this to perform a recursive search of dvd menus in order
>> to find the main feature of a disc.
>>     
> At the least this looks like it should be split into two. The first being the
> vm_stop and vm_close functions the second being the dup functions.
>   
Yes, you are right.  I didn't notice that there were 2 separate things
going on here.  The vm changes are to handle the case where the vm
enters the stop state while playing a disc.  This can happen for
multiple reasons.  Before the patch, the only way to get out of the stop
state was to close dvdnav and re-open it.  I will split these and update
the patches.

>   
>> * nav-reset-deadlock.patch
>> dvdnav_reset takes a lock, then latter calls dvdnav_clear which tries to
>> take
>> the lock again. dead. the unlock that is immediately after dvdnav_clear
>> should be moved to before it.
>>     
> Fine, but what about the conditional change. Is it part of the fix or
> does it deal
> w/ something else. If it deals w/ something else, please separate.
>
>   
Hmm, I probably could have done this better.  dvdnav_reset doesn't clear
this->current_position, but it does clear this->file.  I could have
alternately added code to dvdnav_clear to clear current_position. 

The file test is also needed by the nav-dup-handle.patch. It sets file =
NULL and deliberately doesn't clear dvdnav_t.  Setting file to NULL
forces re-opening it at the next dvdnav_get_next_cache_block.

I'll update this patch as well to put the parts where they belong.



More information about the DVDnav-discuss mailing list