提交 8b7f0766 authored 作者: Seven Du's avatar Seven Du

FS-8748 track pdf total pages and current page

上级 1204abf8
...@@ -393,6 +393,10 @@ struct switch_file_handle { ...@@ -393,6 +393,10 @@ struct switch_file_handle {
char *modname; char *modname;
switch_mm_t mm; switch_mm_t mm;
switch_mutex_t *flag_mutex; switch_mutex_t *flag_mutex;
/*! total video duration, or total page in pdf*/
int64_t duration;
/*! current video position, or current page in pdf */
int64_t vpos;
}; };
/*! \brief Abstract interface to an asr module */ /*! \brief Abstract interface to an asr module */
......
...@@ -161,6 +161,7 @@ static switch_status_t imagick_file_open(switch_file_handle_t *handle, const cha ...@@ -161,6 +161,7 @@ static switch_status_t imagick_file_open(switch_file_handle_t *handle, const cha
} }
context->pagecount = GetImageListLength(context->images); context->pagecount = GetImageListLength(context->images);
handle->duration = context->pagecount;
if (context->max) { if (context->max) {
context->samples = (handle->samplerate / 1000) * context->max; context->samples = (handle->samplerate / 1000) * context->max;
...@@ -359,6 +360,7 @@ static switch_status_t imagick_file_seek(switch_file_handle_t *handle, unsigned ...@@ -359,6 +360,7 @@ static switch_status_t imagick_file_seek(switch_file_handle_t *handle, unsigned
context->pagenumber = page; context->pagenumber = page;
context->same_page = 0; context->same_page = 0;
*cur_sample = page; *cur_sample = page;
handle->vpos = page;
} }
return status; return status;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论