[MPlayer-dev-eng] [PATCH] Fix mp_describe_titleset and related in stream_dvd.c

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Apr 12 13:24:04 CEST 2006


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




More information about the MPlayer-dev-eng mailing list