]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8751 [Conference Play Video Total Time and Current Time]
authorSeven Du <dujinfang@gmail.com>
Wed, 17 Feb 2016 16:10:07 +0000 (00:10 +0800)
committerSeven Du <dujinfang@gmail.com>
Thu, 17 Mar 2016 01:34:58 +0000 (09:34 +0800)
src/mod/applications/mod_av/avformat.c

index 1b5562a135875d5e3d249469cc54451cd579b4e1..d7bd74187b587a335385771b709e60e56ea3abf9 100644 (file)
@@ -1297,6 +1297,7 @@ static switch_status_t open_input_file(av_file_context_t *context, switch_file_h
                        context->video_st.st = context->fc->streams[i];
                        if (switch_test_flag(handle, SWITCH_FILE_FLAG_VIDEO)) {
                                context->has_video = 1;
+                               handle->duration = av_rescale_q(context->video_st.st->duration, context->video_st.st->time_base, AV_TIME_BASE_Q);
                        }
                        handle->mm.source_fps = ceil(av_q2d(context->video_st.st->avg_frame_rate));
                        context->read_fps = (int)handle->mm.source_fps;
@@ -2170,6 +2171,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
 
                pts = av_rescale_q(*((uint64_t *)img->user_priv), st->time_base, AV_TIME_BASE_Q);
                // switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "pkt_pts: %lld pts: %lld queue size: %u\n", *((uint64_t *)img->user_priv), pts, switch_queue_size(context->eh.video_queue));
+               handle->vpos = pts;
 
                if (!context->video_start_time) {
                        context->video_start_time = now - pts;