Commit 7d4433f1 authored by François Grisez's avatar François Grisez

Re-enable the MS_PLAYER_SEEK_MS method of the mkv player filter

parent 11a6869f
......@@ -2292,23 +2292,19 @@ static int player_close(MSFilter *f, void *arg) {
}
static int player_seek_ms(MSFilter *f, void *arg) {
// MKVPlayer *obj = (MKVPlayer *)f->data;
// timecode_t target_position = *((int *)arg);
// ms_bool_t eof;
// ms_filter_lock(f);
// if(target_position < 0 || target_position > matroska_get_duration(&obj->file)) {
// ms_error("MKVPlayer: cannot seek to %d ms. Poisition out of bounds", (int)target_position);
// goto fail;
// }
// matroska_block_go_first(&obj->file);
// while(matroska_block_get_timestamp(&obj->file) < target_position) {
// matroska_block_go_next(&obj->file, &eof);
// }
// ms_filter_unlock(f);
// return 0;
MKVPlayer *obj = (MKVPlayer *)f->data;
int target_position = *((int *)arg);
ms_filter_lock(f);
if(obj->state==MSPlayerClosed) {
ms_error("MKVPlayer: cannot seek. No file open");
goto fail;
}
obj->time = mkv_reader_seek(obj->reader, target_position);
ms_filter_unlock(f);
return 0;
// fail:
// ms_filter_unlock(f);
fail:
ms_filter_unlock(f);
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment