diff -Naur main.orig/etc/menu.conf main/etc/menu.conf --- main.orig/etc/menu.conf 2003-03-27 22:31:54.000000000 +0100 +++ main/etc/menu.conf 2003-03-28 00:16:25.000000000 +0100 @@ -97,6 +97,7 @@ + diff -Naur main.orig/input/input.c main/input/input.c --- main.orig/input/input.c 2003-03-27 22:31:54.000000000 +0100 +++ main/input/input.c 2003-03-27 22:39:30.000000000 +0100 @@ -81,6 +81,9 @@ { MP_CMD_TV_SET_CHANNEL, "tv_set_channel", 1, { { MP_CMD_ARG_STRING, {0}}, {-1,{0}} }}, { MP_CMD_TV_LAST_CHANNEL, "tv_last_channel", 0, { {-1,{0}} } }, #endif +#ifdef HAVE_VCD + { MP_CMD_VCD_PLAY, "play_vcd", 0, { {-1,{0}} } }, +#endif { MP_CMD_VO_FULLSCREEN, "vo_fullscreen", 0, { {-1,{0}} } }, { MP_CMD_SCREENSHOT, "screenshot", 0, { {-1,{0}} } }, { MP_CMD_PANSCAN, "panscan",1, { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, diff -Naur main.orig/input/input.h main/input/input.h --- main.orig/input/input.h 2003-03-27 22:31:54.000000000 +0100 +++ main/input/input.h 2003-03-27 22:38:22.000000000 +0100 @@ -42,6 +42,7 @@ #endif #define MP_CMD_SUB_ALIGNMENT 39 #define MP_CMD_TV_LAST_CHANNEL 40 +#define MP_CMD_VCD_PLAY 41 #define MP_CMD_GUI_EVENTS 5000 #define MP_CMD_GUI_LOADFILE 5001 diff -Naur main.orig/libmenu/menu_cmdlist.c main/libmenu/menu_cmdlist.c --- main.orig/libmenu/menu_cmdlist.c 2003-03-27 22:31:54.000000000 +0100 +++ main/libmenu/menu_cmdlist.c 2003-03-27 22:56:09.000000000 +0100 @@ -84,7 +84,7 @@ } static int parse_args(menu_t* menu,char* args) { - char *element,*body, **attribs, *name, *ok, *cancel; + char *element,*body, **attribs, *name, *ok, *cancel, *cond; list_entry_t* m = NULL; int r; ASX_Parser_t* parser = asx_parser_new(); @@ -112,11 +112,21 @@ } ok = asx_get_attrib("ok",attribs); cancel = asx_get_attrib("cancel",attribs); + cond = asx_get_attrib("cond",attribs); m = calloc(1,sizeof(struct list_entry_s)); m->p.txt = name; m->ok = ok; m->cancel = cancel; - menu_list_add_entry(menu,m); + + if (cond != NULL) { + if (!strcmp(cond, "vcd")) { +#ifdef HAVE_VCD + menu_list_add_entry(menu,m); +#endif + } + } + else + menu_list_add_entry(menu,m); free(element); if(body) free(body); diff -Naur main.orig/libmenu/menu_pt.c main/libmenu/menu_pt.c --- main.orig/libmenu/menu_pt.c 2003-03-27 22:31:54.000000000 +0100 +++ main/libmenu/menu_pt.c 2003-03-27 22:51:14.000000000 +0100 @@ -126,8 +126,16 @@ /* NOP */; for( ; i != NULL ; i = i->next ) { e = calloc(1,sizeof(list_entry_t)); - if(i->files) + if(i->files) { +#ifdef HAVE_VCD + if (i->entry_type == PLAY_TREE_ENTRY_VCD) { + e->p.txt = (char *) malloc (10*sizeof(char)); + sprintf(e->p.txt, "Title %s", mp_basename(i->files[0])); + } + else +#endif e->p.txt = mp_basename(i->files[0]); + } else e->p.txt = "Group ..."; e->pt = i; diff -Naur main.orig/mplayer.c main/mplayer.c --- main.orig/mplayer.c 2003-03-27 22:31:54.000000000 +0100 +++ main/mplayer.c 2003-03-27 23:59:41.000000000 +0100 @@ -2345,6 +2345,36 @@ case MP_CMD_QUIT : { exit_player_with_rc(MSGTR_Exit_quit, 0); } +#ifdef HAVE_VCD + case MP_CMD_VCD_PLAY : { + char buf[10]; + play_tree_t *vcd, *tracks; + stream_t *s; + + tracks = play_tree_new(); + play_tree_add_file(tracks, "vcd://1"); + + if ((s = open_stream (NULL, 1, NULL)) == NULL) + break; + for (i=2; i<100; i++) + { + if (vcd_seek_to_track (s->fd, i) < 0) + break; + vcd = play_tree_new(); + sprintf(buf, "vcd://%d", i); + play_tree_add_file(vcd, buf); + play_tree_append_entry(tracks, vcd); + } + free_stream (s); + + // Go back to the start point + while(play_tree_iter_up_step(playtree_iter, 0, 1) != PLAY_TREE_ITER_END); + play_tree_free_list(playtree->child, 1); + play_tree_set_child(playtree, tracks); + play_tree_iter_step(playtree_iter, 0, 0); + eof = PT_NEXT_SRC; + } break; +#endif case MP_CMD_GRAB_FRAMES : { grab_frames=2; } break;