From 4992d8bf7ddee25641e25e939f616628c64b36c3 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Thu, 29 Mar 2007 05:24:35 +0000 Subject: [PATCH] Change the vhook code to send real timestamps to the filters instead of the current time of day, which is useless, and which the filters could just as easily query for themselves. patch by Bobby Bingham, uhmmmm gmail com Originally committed as revision 8541 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 3 ++- libavformat/framehook.c | 3 +-- libavformat/framehook.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 3f12c1f089..1a17d4f172 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -601,7 +601,8 @@ static void pre_process_video_frame(AVInputStream *ist, AVPicture *picture, void picture2 = picture; } - frame_hook_process(picture2, dec->pix_fmt, dec->width, dec->height); + frame_hook_process(picture2, dec->pix_fmt, dec->width, dec->height, + 1000000 * ist->pts / AV_TIME_BASE); if (picture != picture2) *picture = *picture2; diff --git a/libavformat/framehook.c b/libavformat/framehook.c index 8f5ddd66f8..8738f80307 100644 --- a/libavformat/framehook.c +++ b/libavformat/framehook.c @@ -93,11 +93,10 @@ int frame_hook_add(int argc, char *argv[]) #endif } -void frame_hook_process(AVPicture *pict, enum PixelFormat pix_fmt, int width, int height) +void frame_hook_process(AVPicture *pict, enum PixelFormat pix_fmt, int width, int height, int64_t pts) { if (first_hook) { FrameHookEntry *fhe; - int64_t pts = av_gettime(); for (fhe = first_hook; fhe; fhe = fhe->next) { fhe->Process(fhe->ctx, pict, pix_fmt, width, height, pts); diff --git a/libavformat/framehook.h b/libavformat/framehook.h index bcaa0c92df..06ed4f8898 100644 --- a/libavformat/framehook.h +++ b/libavformat/framehook.h @@ -46,7 +46,7 @@ typedef FrameHookRelease *FrameHookReleaseFn; extern FrameHookRelease Release; extern int frame_hook_add(int argc, char *argv[]); -extern void frame_hook_process(struct AVPicture *pict, enum PixelFormat pix_fmt, int width, int height); +extern void frame_hook_process(struct AVPicture *pict, enum PixelFormat pix_fmt, int width, int height, int64_t pts); extern void frame_hook_release(void); #endif