[PATCH] Fix mp_describe_titleset and related in stream_dvd.c
This patch corrects a few problems introduced by the commit that added STREAM_CTRL_GET_TIME_LENGTH control in stream_dvd.c: 1. mp_describe_titleset opened by didn't close a vts if it didn't have a vtsi_mat or vts_pgcit. 2. if(tt_srpt->title[title_no].title_set_nr == vts_no) check moved to mp_get_titleset_length and so mp_describe_titleset produced heaps of wrong output. 3. STREAM_CTRL_GET_TIME_LENGTH control wrongly assumed that every title has its own vts. Need to use title_set_nr from tt_srpt->title instead. 4. mp_describe_titleset didn't return a value on success. Someone please apply. -- kiriuja
kiriuja wrote:
This patch corrects a few problems introduced by the commit that added STREAM_CTRL_GET_TIME_LENGTH control in stream_dvd.c:
1. mp_describe_titleset opened by didn't close a vts if it didn't have a vtsi_mat or vts_pgcit.
2. if(tt_srpt->title[title_no].title_set_nr == vts_no) check moved to mp_get_titleset_length and so mp_describe_titleset produced heaps of wrong output.
3. STREAM_CTRL_GET_TIME_LENGTH control wrongly assumed that every title has its own vts. Need to use title_set_nr from tt_srpt->title instead.
4. mp_describe_titleset didn't return a value on success.
Someone please apply.
-- kiriuja
looks reasonable, but tonight I want to test it on a couple of dvds I have before committing it -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Ricevi picture SMS per il tuo cellulare da Jamba! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=4847&d=11-4
Hi, On Mon, Apr 10, 2006 at 07:05:27AM -0400, kiriuja wrote:
2. if(tt_srpt->title[title_no].title_set_nr == vts_no) check moved to mp_get_titleset_length and so mp_describe_titleset produced heaps of wrong output.
Already fixed in a different way in CVS, could you please update your patch? Greetings, Reimar Döffinger
On Tuesday 11 April 2006 10:13 Reimar Döffinger wrote:
Hi, On Mon, Apr 10, 2006 at 07:05:27AM -0400, kiriuja wrote:
2. if(tt_srpt->title[title_no].title_set_nr == vts_no) check moved to mp_get_titleset_length and so mp_describe_titleset produced heaps of wrong output.
Already fixed in a different way in CVS, could you please update your patch?
Updated patch attached. -- kiriuja
Hi,
@@ -444,12 +444,9 @@ static int mp_get_titleset_length(ifo_ha
if(vts_file->vtsi_mat && vts_file->vts_pgcit) { - if(tt_srpt->title[title_no].title_set_nr == vts_no) - { vts_ttn = tt_srpt->title[title_no].vts_ttn - 1; pgc_no = vts_file->vts_ptt_srpt->title[vts_ttn].ptt[0].pgcn - 1; msec = dvdtimetomsec(&vts_file->vts_pgcit->pgci_srp[pgc_no].pgc->playback_time); - } }
probably makes sense, but if applied, the vts_no function parameter IMHO should be removed as well.
@@ -465,7 +462,10 @@ static int mp_describe_titleset(dvd_read return 0;
if(!vts_file->vtsi_mat || !vts_file->vts_pgcit) + { + ifoClose(vts_file); return 0; + }
for(title_no = 0; title_no < tt_srpt->nr_of_srpts; title_no++) { @@ -475,6 +475,7 @@ static int mp_describe_titleset(dvd_read mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_DVD_TITLE_%d_LENGTH=%d.%03d\n", title_no + 1, msec / 1000, msec % 1000); } ifoClose(vts_file); + return 1; }
Not controversial I guess, so applied.
@@ -484,7 +485,7 @@ static int control(stream_t *stream,int case STREAM_CTRL_GET_TIME_LENGTH: { dvd_priv_t *d = stream->priv; - *((unsigned int *)arg) = mp_get_titleset_length(d->vts_file, d->tt_srpt, d->cur_title, d->cur_title-1); + *((unsigned int *)arg) = mp_get_titleset_length(d->vts_file, d->tt_srpt, d->tt_srpt->title[d->cur_title-1].title_set_nr, d->cur_title-1); return 1;
Hmm... If the first hunk is applied this won't make any difference, will it?? Though getting rid of the vts_no parameter would make this line a more sane length *g* Greetings, Reimar Döffinger
Updated patch attached. -- kiriuja
Hi, On Wed, Apr 12, 2006 at 09:30:56PM -0400, kiriuja wrote:
Updated patch attached.
applied. Greetings, Reimar Döffinger
participants (3)
-
kiriuja -
Nico Sabbi -
Reimar Döffinger