ext/ffmpeg/gstffmpegdec.c: Be a bit smarter when clipping the frame without a duration, we don't want the frame to ex...

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (clip_video_buffer),
(gst_ffmpegdec_video_frame):
Be a bit smarter when clipping the frame without a duration, we don't
want the frame to extend to the end of the segment in this case.
This commit is contained in:
Wim Taymans 2007-05-25 10:41:56 +00:00
parent 6b4825428d
commit c413858fe6
2 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2007-05-25 Wim Taymans <wim@fluendo.com>
* ext/ffmpeg/gstffmpegdec.c: (clip_video_buffer),
(gst_ffmpegdec_video_frame):
Be a bit smarter when clipping the frame without a duration, we don't
want the frame to extend to the end of the segment in this case.
2007-05-24 Tim-Philipp Müller <tim at centricular dot net> 2007-05-24 Tim-Philipp Müller <tim at centricular dot net>
* configure.ac: * configure.ac:

View file

@ -1141,12 +1141,21 @@ clip_video_buffer (GstFFMpegDec * dec, GstBuffer * buf, GstClockTime in_ts,
if (G_UNLIKELY (!res)) if (G_UNLIKELY (!res))
goto beach; goto beach;
/* we're pretty sure the duration of this buffer is not till the end of this
* segment (which _clip will assume when the stop is -1) */
if (stop == GST_CLOCK_TIME_NONE)
cstop = GST_CLOCK_TIME_NONE;
/* update timestamp and possibly duration if the clipped stop time is /* update timestamp and possibly duration if the clipped stop time is
* valid */ * valid */
GST_BUFFER_TIMESTAMP (buf) = cstart; GST_BUFFER_TIMESTAMP (buf) = cstart;
if (GST_CLOCK_TIME_IS_VALID (cstop)) if (GST_CLOCK_TIME_IS_VALID (cstop))
GST_BUFFER_DURATION (buf) = cstop - cstart; GST_BUFFER_DURATION (buf) = cstop - cstart;
GST_LOG_OBJECT (dec,
"clipped timestamp:%" GST_TIME_FORMAT " , duration:%" GST_TIME_FORMAT,
GST_TIME_ARGS (cstart), GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
beach: beach:
GST_LOG_OBJECT (dec, "%sdropping", (res ? "not " : "")); GST_LOG_OBJECT (dec, "%sdropping", (res ? "not " : ""));
return res; return res;
@ -1407,6 +1416,9 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
} }
} }
} }
else {
GST_LOG_OBJECT (ffmpegdec, "using in_duration");
}
/* Take repeat_pict into account */ /* Take repeat_pict into account */
if (GST_CLOCK_TIME_IS_VALID (in_duration)) { if (GST_CLOCK_TIME_IS_VALID (in_duration)) {