[FFmpeg-soc] [soc]: r942 - in libavfilter: avfilter.h ffmpeg.diff vf_fps.c
koorogi
subversion at mplayerhq.hu
Sat Aug 18 03:42:42 CEST 2007
Author: koorogi
Date: Sat Aug 18 03:42:42 2007
New Revision: 942
Log:
use units of 1/AV_TIME_BASE for pts rather than milliseconds
Modified:
libavfilter/avfilter.h
libavfilter/ffmpeg.diff
libavfilter/vf_fps.c
Modified: libavfilter/avfilter.h
==============================================================================
--- libavfilter/avfilter.h (original)
+++ libavfilter/avfilter.h Sat Aug 18 03:42:42 2007
@@ -72,7 +72,7 @@ typedef struct AVFilterPicRef
int w; ///< image width
int h; ///< image height
- int64_t pts; ///< presentation timestamp in milliseconds
+ int64_t pts; ///< presentation timestamp in units of 1/AV_TIME_BASE
int perms; ///< permissions
#define AV_PERM_READ 0x01 ///< can read from the buffer
Modified: libavfilter/ffmpeg.diff
==============================================================================
--- libavfilter/ffmpeg.diff (original)
+++ libavfilter/ffmpeg.diff Sat Aug 18 03:42:42 2007
@@ -235,8 +235,8 @@ Index: ffplay.c
-// break;
- if (got_picture) {
- if (output_picture2(is, frame, pts) < 0)
-+ /* put pts into milliseconds */
-+ *pts = 1000 * (*pts) * is->video_st->time_base.num /
++ /* put pts into units of 1/AV_TIME_BASE */
++ *pts = AV_TIME_BASE * (*pts) * is->video_st->time_base.num /
+ is->video_st->time_base.den;
+
+ av_free_packet(pkt);
@@ -423,7 +423,7 @@ Index: ffplay.c
+ while(get_video_frame(is, frame, &pts_int)) {
+#endif
+ pts = pts_int;
-+ pts /= 1000.0;
++ pts /= AV_TIME_BASE;
+ if(output_picture2(is, frame, pts) < 0)
goto the_end;
}
Modified: libavfilter/vf_fps.c
==============================================================================
--- libavfilter/vf_fps.c (original)
+++ libavfilter/vf_fps.c Sat Aug 18 03:42:42 2007
@@ -38,10 +38,10 @@ static int init(AVFilterContext *ctx, co
/* TODO: support framerates specified as decimals or fractions */
if(args && sscanf(args, "%d", &framerate))
- fps->timebase = 1000 / framerate;
+ fps->timebase = AV_TIME_BASE / framerate;
else
/* default to 25 fps */
- fps->timebase = 1000 / 25;
+ fps->timebase = AV_TIME_BASE / 25;
return 0;
}
More information about the FFmpeg-soc
mailing list