comparison stream/stream_bluray.c @ 37113:f5b5c7246439

bluray: add some missing stream controls. Will all exact time-based seeking and displaying the correct time and duration.
author reimar
date Tue, 27 May 2014 19:22:07 +0000
parents c602dc916e07
children 297da727ee2b
comparison
equal deleted inserted replaced
37112:608c83ef5c0c 37113:f5b5c7246439
194 pos = bd_chapter_pos(b->bd, chapter); 194 pos = bd_chapter_pos(b->bd, chapter);
195 r = bluray_stream_seek(s, pos); 195 r = bluray_stream_seek(s, pos);
196 bd_free_title_info(ti); 196 bd_free_title_info(ti);
197 197
198 return r ? 1 : STREAM_UNSUPPORTED; 198 return r ? 1 : STREAM_UNSUPPORTED;
199 }
200
201 case STREAM_CTRL_GET_TIME_LENGTH: {
202 BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, b->current_title, b->current_angle);
203 if (!ti)
204 return STREAM_UNSUPPORTED;
205 *(double *)arg = ti->duration / 90000.0;
206 return STREAM_OK;
207 }
208
209 case STREAM_CTRL_GET_CURRENT_TIME:
210 *(double *)arg = bd_tell_time(b->bd) / 90000.0;
211 return STREAM_OK;
212 case STREAM_CTRL_SEEK_TO_TIME: {
213 int64_t res = bd_seek_time(b->bd, *(double*)arg * 90000.0);
214 if (res < 0)
215 return STREAM_ERROR;
216 s->pos = res;
217 return 1;
199 } 218 }
200 219
201 case STREAM_CTRL_GET_NUM_ANGLES: { 220 case STREAM_CTRL_GET_NUM_ANGLES: {
202 BLURAY_TITLE_INFO *ti; 221 BLURAY_TITLE_INFO *ti;
203 222