[MPlayer-dev-eng] Chapter selection via libmenu

Nico Sabbi Nicola.Sabbi at poste.it
Mon Dec 10 10:54:40 CET 2007


Il Monday 10 December 2007 10:33:46 Andrew Calkin ha scritto:
> Hi,
>
> The attached patch does $subj. DVD and mkv files that have chapters
> can be navigated via libmenu via seeks to chapter markers using
> this patch. Please review.
>
> //Andrew

> if (stream->type == STREAMTYPE_DVD)
>+    {
>+      dvd_priv_t *dvd_p = (dvd_priv_t *)stream->priv;
>+      int dvd_title = dvd_p->cur_title-1;
>+      char textbuf[3];
>+
>+      for (cid = 0;
>+           cid < dvd_p->tt_srpt->title[dvd_title].nr_of_ptts;
>+           cid++)
>+      {
>+        if ((e = calloc (1, sizeof (list_entry_t))) != NULL)
>+        {
>+          sprintf (textbuf, "%d", cid+1);
>+          e->p.next = NULL;
>+          e->p.txt = strdup (textbuf);
>+          e->cid = cid;
>+          menu_list_add_entry (menu, e);
>+        }
>+      }
>+    }
>+    else if (demuxer->type == DEMUXER_TYPE_MATROSKA)
>+    {
>+      for (cid = 0; cid < demuxer->num_chapters; cid++)
>+      {
>+        if ((e = calloc (1, sizeof (list_entry_t))) != NULL)
>+        {
>+          e->p.next = NULL;
>+          e->p.txt = strdup (demuxer->chapters[cid].name);
>+          e->cid = cid;
>+          menu_list_add_entry (menu, e);
>+        }
>+      }
>+    }

unacceptable, rejected


More information about the MPlayer-dev-eng mailing list