comparison command.c @ 25884:f6697d25b040

More places that should use SEEK_ABSOLUTE / SEEK_FACTOR
author reimar
date Tue, 29 Jan 2008 16:22:34 +0000
parents 05cde5afd1d8
children 36bc17c090a6
comparison
equal deleted inserted replaced
25883:baf32110d3fc 25884:f6697d25b040
342 default: 342 default:
343 return m_property_int_ro(prop, action, arg, 343 return m_property_int_ro(prop, action, arg,
344 demuxer_get_percent_pos(mpctx->demuxer)); 344 demuxer_get_percent_pos(mpctx->demuxer));
345 } 345 }
346 346
347 abs_seek_pos = 3; 347 abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR;
348 rel_seek_secs = pos / 100.0; 348 rel_seek_secs = pos / 100.0;
349 return M_PROPERTY_OK; 349 return M_PROPERTY_OK;
350 } 350 }
351 351
352 /// Current position in seconds (RW) 352 /// Current position in seconds (RW)
357 357
358 switch(action) { 358 switch(action) {
359 case M_PROPERTY_SET: 359 case M_PROPERTY_SET:
360 if(!arg) return M_PROPERTY_ERROR; 360 if(!arg) return M_PROPERTY_ERROR;
361 M_PROPERTY_CLAMP(prop, *(double*)arg); 361 M_PROPERTY_CLAMP(prop, *(double*)arg);
362 abs_seek_pos = 1; 362 abs_seek_pos = SEEK_ABSOLUTE;
363 rel_seek_secs = *(double*)arg; 363 rel_seek_secs = *(double*)arg;
364 return M_PROPERTY_OK; 364 return M_PROPERTY_OK;
365 case M_PROPERTY_STEP_UP: 365 case M_PROPERTY_STEP_UP:
366 case M_PROPERTY_STEP_DOWN: 366 case M_PROPERTY_STEP_DOWN:
367 rel_seek_secs += (arg ? *(double*)arg : 10.0) * 367 rel_seek_secs += (arg ? *(double*)arg : 10.0) *
427 abs_seek_pos = 0; 427 abs_seek_pos = 0;
428 chapter = demuxer_seek_chapter(mpctx->demuxer, chapter, 1, 428 chapter = demuxer_seek_chapter(mpctx->demuxer, chapter, 1,
429 &next_pts, &chapter_num, &chapter_name); 429 &next_pts, &chapter_num, &chapter_name);
430 if (chapter >= 0) { 430 if (chapter >= 0) {
431 if (next_pts > -1.0) { 431 if (next_pts > -1.0) {
432 abs_seek_pos = 1; 432 abs_seek_pos = SEEK_ABSOLUTE;
433 rel_seek_secs = next_pts; 433 rel_seek_secs = next_pts;
434 } 434 }
435 if (chapter_name) 435 if (chapter_name)
436 set_osd_msg(OSD_MSG_TEXT, 1, osd_duration, 436 set_osd_msg(OSD_MSG_TEXT, 1, osd_duration,
437 MSGTR_OSDChapter, chapter + 1, chapter_name); 437 MSGTR_OSDChapter, chapter + 1, chapter_name);
2308 if (sh_video) 2308 if (sh_video)
2309 mpctx->osd_show_percentage = sh_video->fps; 2309 mpctx->osd_show_percentage = sh_video->fps;
2310 v = cmd->args[0].v.f; 2310 v = cmd->args[0].v.f;
2311 abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0; 2311 abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0;
2312 if (abs == 2) { /* Absolute seek to a specific timestamp in seconds */ 2312 if (abs == 2) { /* Absolute seek to a specific timestamp in seconds */
2313 abs_seek_pos = 1; 2313 abs_seek_pos = SEEK_ABSOLUTE;
2314 if (sh_video) 2314 if (sh_video)
2315 mpctx->osd_function = 2315 mpctx->osd_function =
2316 (v > sh_video->pts) ? OSD_FFW : OSD_REW; 2316 (v > sh_video->pts) ? OSD_FFW : OSD_REW;
2317 rel_seek_secs = v; 2317 rel_seek_secs = v;
2318 } else if (abs) { /* Absolute seek by percentage */ 2318 } else if (abs) { /* Absolute seek by percentage */
2319 abs_seek_pos = 3; 2319 abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR;
2320 if (sh_video) 2320 if (sh_video)
2321 mpctx->osd_function = OSD_FFW; // Direction isn't set correctly 2321 mpctx->osd_function = OSD_FFW; // Direction isn't set correctly
2322 rel_seek_secs = v / 100.0; 2322 rel_seek_secs = v / 100.0;
2323 } else { 2323 } else {
2324 rel_seek_secs += v; 2324 rel_seek_secs += v;