annotate navigation.c @ 168:330ef38ad968 src

Add files from libdvdread. This is to provide better integration with libdvdnav. Better error messages reported to the application etc. We will modify libdvdread files to be portable across all compilers. Currently, libdvdread only behaves with gcc. libdvdread does not like Microsoft Compilers. This portability modification will change libdvdread so much, that I thought it best to finally combine libdvdnav and libdvdread into one lib. Currently the added files are not used. Future commits will change that.
author jcdutton
date Sun, 27 Apr 2003 00:00:49 +0000
parents 25b0c4f881c3
children b80dff4bef76
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
1 /*
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
2 * Copyright (C) 2000 Rich Wareham <richwareham@users.sourceforge.net>
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
3 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
4 * This file is part of libdvdnav, a DVD navigation library.
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
5 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
6 * libdvdnav is free software; you can redistribute it and/or modify
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
9 * (at your option) any later version.
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
10 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
11 * libdvdnav is distributed in the hope that it will be useful,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
14 * GNU General Public License for more details.
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
15 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
19 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
20 * $Id$
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
21 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
22 */
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
23
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
24 #ifdef HAVE_CONFIG_H
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
25 #include "config.h"
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
26 #endif
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
27
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
28 #include "dvdnav_internal.h"
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
29
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
30 /* Navigation API calls */
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
31
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
32 dvdnav_status_t dvdnav_still_skip(dvdnav_t *this) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
33 if(!this) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
34 printerr("Passed a NULL pointer.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
35 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
36 }
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
37
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
38 this->position_current.still = 0;
23
c2d40c38e12f Name stills work better.
jcdutton
parents: 22
diff changeset
39 this->skip_still = 1;
116
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
40 this->sync_wait = 0;
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
41 this->sync_wait_skip = 1;
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
42
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
43 return S_OK;
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
44 }
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
45
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
46 dvdnav_status_t dvdnav_wait_skip(dvdnav_t *this) {
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
47 if(!this) {
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
48 printerr("Passed a NULL pointer.");
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
49 return S_ERR;
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
50 }
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
51
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
52 this->sync_wait = 0;
4d711d0518e9 new event DVDNAV_WAIT
mroi
parents: 114
diff changeset
53 this->sync_wait_skip = 1;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
54
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
55 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
56 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
57
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
58 dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *this, int *titles) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
59 if(!this || !titles) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
60 printerr("Passed a NULL pointer.");
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
61 return S_ERR;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
62 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
63
94
e29110f67f3a Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents: 90
diff changeset
64 if(!this->started) {
e29110f67f3a Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents: 90
diff changeset
65 /* Start the VM */
e29110f67f3a Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents: 90
diff changeset
66 vm_start(this->vm);
e29110f67f3a Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents: 90
diff changeset
67 this->started = 1;
e29110f67f3a Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents: 90
diff changeset
68 }
e29110f67f3a Get xine dvd:///dev/dvd:1.2 i.e. title play working again.
jcdutton
parents: 90
diff changeset
69
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
70 (*titles) = vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
71
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
72 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
73 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
74
95
e7ebabe059b9 Start to get dvd mrl working in xine.
jcdutton
parents: 94
diff changeset
75 dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *this, int title, int *parts) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
76 if(!this || !parts) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
77 printerr("Passed a NULL pointer.");
5
c1b55dc1bfed Add API call to get number of programmes in current title.
richwareham
parents: 0
diff changeset
78 return S_ERR;
c1b55dc1bfed Add API call to get number of programmes in current title.
richwareham
parents: 0
diff changeset
79 }
95
e7ebabe059b9 Start to get dvd mrl working in xine.
jcdutton
parents: 94
diff changeset
80 if(!this->started) {
e7ebabe059b9 Start to get dvd mrl working in xine.
jcdutton
parents: 94
diff changeset
81 printerr("Virtual DVD machine not started.");
e7ebabe059b9 Start to get dvd mrl working in xine.
jcdutton
parents: 94
diff changeset
82 return S_ERR;
e7ebabe059b9 Start to get dvd mrl working in xine.
jcdutton
parents: 94
diff changeset
83 }
e7ebabe059b9 Start to get dvd mrl working in xine.
jcdutton
parents: 94
diff changeset
84 if ((title < 1) || (title > vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts) ) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
85 printerr("Passed a title number out of range.");
95
e7ebabe059b9 Start to get dvd mrl working in xine.
jcdutton
parents: 94
diff changeset
86 return S_ERR;
e7ebabe059b9 Start to get dvd mrl working in xine.
jcdutton
parents: 94
diff changeset
87 }
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
88
95
e7ebabe059b9 Start to get dvd mrl working in xine.
jcdutton
parents: 94
diff changeset
89 (*parts) = vm_get_vmgi(this->vm)->tt_srpt->title[title-1].nr_of_ptts;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
90
5
c1b55dc1bfed Add API call to get number of programmes in current title.
richwareham
parents: 0
diff changeset
91 return S_OK;
c1b55dc1bfed Add API call to get number of programmes in current title.
richwareham
parents: 0
diff changeset
92 }
c1b55dc1bfed Add API call to get number of programmes in current title.
richwareham
parents: 0
diff changeset
93
90
eeabf5a51b2b Improve chapter selection functions.
jcdutton
parents: 26
diff changeset
94 dvdnav_status_t dvdnav_current_title_info(dvdnav_t *this, int *title, int *part) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
95 int retval;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
96
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
97 if(!this || !title || !part) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
98 printerr("Passed a NULL pointer.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
99 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
100 }
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
101
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
102 pthread_mutex_lock(&this->vm_lock);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
103 if (!this->vm->vtsi || !this->vm->vmgi) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
104 printerr("Bad VM state.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
105 pthread_mutex_unlock(&this->vm_lock);
90
eeabf5a51b2b Improve chapter selection functions.
jcdutton
parents: 26
diff changeset
106 return S_ERR;
eeabf5a51b2b Improve chapter selection functions.
jcdutton
parents: 26
diff changeset
107 }
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
108 if (!this->vm->state.pgc) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
109 printerr("No current PGC.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
110 pthread_mutex_unlock(&this->vm_lock);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
111 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
112 }
158
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
113 if ( (this->vm->state.domain == VTSM_DOMAIN)
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
114 || (this->vm->state.domain == VMGM_DOMAIN) ) {
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
115 /* Get current Menu ID: into *part. */
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
116 vm_get_current_menu(this->vm, part);
159
25b0c4f881c3 Fix Menu type display.
jcdutton
parents: 158
diff changeset
117 if (*part > -1) {
25b0c4f881c3 Fix Menu type display.
jcdutton
parents: 158
diff changeset
118 *title = 0;
157
7094c8661c05 Return details about menu number in dvdnav_current_title_info()
jcdutton
parents: 146
diff changeset
119 pthread_mutex_unlock(&this->vm_lock);
7094c8661c05 Return details about menu number in dvdnav_current_title_info()
jcdutton
parents: 146
diff changeset
120 return S_OK;
7094c8661c05 Return details about menu number in dvdnav_current_title_info()
jcdutton
parents: 146
diff changeset
121 }
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
122 }
158
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
123 if (this->vm->state.domain == VTS_DOMAIN) {
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
124 retval = vm_get_current_title_part(this->vm, title, part);
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
125 pthread_mutex_unlock(&this->vm_lock);
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
126 return retval ? S_OK : S_ERR;
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
127 }
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
128 printerr("Not in a title or menu.");
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
129 pthread_mutex_unlock(&this->vm_lock);
158
66a615581b3f Tidy up a bit.
jcdutton
parents: 157
diff changeset
130 return S_ERR;
90
eeabf5a51b2b Improve chapter selection functions.
jcdutton
parents: 26
diff changeset
131 }
eeabf5a51b2b Improve chapter selection functions.
jcdutton
parents: 26
diff changeset
132
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
133 dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int title) {
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
134 if(!this) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
135 printerr("Passed a NULL pointer.");
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
136 return S_ERR;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
137 }
90
eeabf5a51b2b Improve chapter selection functions.
jcdutton
parents: 26
diff changeset
138 return dvdnav_part_play(this, title, 1);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
139 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
140
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
141 dvdnav_status_t dvdnav_part_play(dvdnav_t *this, int title, int part) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
142 int retval;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
143
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
144 if(!this) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
145 printerr("Passed a NULL pointer.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
146 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
147 }
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
148
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
149 pthread_mutex_lock(&this->vm_lock);
137
15e239caef8f title/part jumping does not need a valid vtsi
mroi
parents: 136
diff changeset
150 if (!this->vm->vmgi) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
151 printerr("Bad VM state.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
152 pthread_mutex_unlock(&this->vm_lock);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
153 return S_ERR;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
154 }
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
155 if (!this->vm->state.pgc) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
156 printerr("No current PGC.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
157 pthread_mutex_unlock(&this->vm_lock);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
158 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
159 }
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
160 if((title < 1) || (title > this->vm->vmgi->tt_srpt->nr_of_srpts)) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
161 printerr("Title out of range.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
162 pthread_mutex_unlock(&this->vm_lock);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
163 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
164 }
140
33d6bb570dcb one additional sanity check on the part number
mroi
parents: 137
diff changeset
165 if((part < 1) || (part > this->vm->vmgi->tt_srpt->title[title-1].nr_of_ptts)) {
33d6bb570dcb one additional sanity check on the part number
mroi
parents: 137
diff changeset
166 printerr("Part out of range.");
33d6bb570dcb one additional sanity check on the part number
mroi
parents: 137
diff changeset
167 pthread_mutex_unlock(&this->vm_lock);
33d6bb570dcb one additional sanity check on the part number
mroi
parents: 137
diff changeset
168 return S_ERR;
33d6bb570dcb one additional sanity check on the part number
mroi
parents: 137
diff changeset
169 }
33d6bb570dcb one additional sanity check on the part number
mroi
parents: 137
diff changeset
170
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
171 retval = vm_jump_title_part(this->vm, title, part);
133
d09a81cf65ce determine correct PG and PTT numbers when seeking across PG boundaries
mroi
parents: 116
diff changeset
172 if (retval)
d09a81cf65ce determine correct PG and PTT numbers when seeking across PG boundaries
mroi
parents: 116
diff changeset
173 this->vm->hop_channel++;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
174 pthread_mutex_unlock(&this->vm_lock);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
175
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
176 return retval ? S_OK : S_ERR;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
177 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
178
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
179 dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *this, int title,
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
180 int part, int parts_to_play) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
181 /* FIXME: Implement auto-stop */
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
182 if (dvdnav_part_play(this, title, part) == S_OK)
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
183 printerr("Not implemented yet.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
184 return S_ERR;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
185 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
186
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
187 dvdnav_status_t dvdnav_time_play(dvdnav_t *this, int title,
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
188 unsigned long int time) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
189 if(!this) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
190 printerr("Passed a NULL pointer.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
191 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
192 }
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
193
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
194 /* FIXME: Implement */
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
195 printerr("Not implemented yet.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
196 return S_ERR;
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
197 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
198
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
199 dvdnav_status_t dvdnav_stop(dvdnav_t *this) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
200 if(!this) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
201 printerr("Passed a NULL pointer.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
202 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
203 }
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
204
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
205 pthread_mutex_lock(&this->vm_lock);
146
7f242ec838fd do not stop the VM here, get_next_block will do that without races
mroi
parents: 140
diff changeset
206 this->vm->stopped = 1;
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
207 pthread_mutex_unlock(&this->vm_lock);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
208 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
209 }
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
210
22
3c1df0cb3aee Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents: 5
diff changeset
211 dvdnav_status_t dvdnav_go_up(dvdnav_t *this) {
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
212 if(!this) {
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
213 printerr("Passed a NULL pointer.");
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
214 return S_ERR;
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
215 }
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
216
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
217 /* A nice easy function... delegate to the VM */
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
218 pthread_mutex_lock(&this->vm_lock);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
219 vm_jump_up(this->vm);
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 95
diff changeset
220 pthread_mutex_unlock(&this->vm_lock);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
221
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
222 return S_OK;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
223 }