mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
ext/ffmpeg/gstffmpegdec.c: Only do timestamp interpolation for delayed streams (containing
Original commit message from CVS: * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame): Only do timestamp interpolation for delayed streams (containing B-frames). Fixes stuttering playback of ASF files (#306770).
This commit is contained in:
parent
b863f44a1a
commit
4869163a53
2 changed files with 15 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-06-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
|
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame):
|
||||||
|
Only do timestamp interpolation for delayed streams (containing
|
||||||
|
B-frames). Fixes stuttering playback of ASF files (#306770).
|
||||||
|
|
||||||
2005-06-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
2005-06-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
|
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
|
||||||
|
|
|
@ -685,7 +685,7 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
|
||||||
|
|
||||||
if (ffmpegdec->picture->opaque != NULL) {
|
if (ffmpegdec->picture->opaque != NULL) {
|
||||||
outbuf = (GstBuffer *) ffmpegdec->picture->opaque;
|
outbuf = (GstBuffer *) ffmpegdec->picture->opaque;
|
||||||
}else {
|
} else {
|
||||||
AVPicture pic;
|
AVPicture pic;
|
||||||
gint fsize = gst_ffmpeg_avpicture_get_size (ffmpegdec->context->pix_fmt,
|
gint fsize = gst_ffmpeg_avpicture_get_size (ffmpegdec->context->pix_fmt,
|
||||||
ffmpegdec->context->width, ffmpegdec->context->height);
|
ffmpegdec->context->width, ffmpegdec->context->height);
|
||||||
|
@ -717,10 +717,12 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
|
||||||
* For B-frame containing movies, we get all pictures delayed
|
* For B-frame containing movies, we get all pictures delayed
|
||||||
* except for the I frames, so we synchronize only on I frames
|
* except for the I frames, so we synchronize only on I frames
|
||||||
* and keep an internal counter based on FPS for the others. */
|
* and keep an internal counter based on FPS for the others. */
|
||||||
if ((ffmpegdec->picture->pict_type == FF_I_TYPE ||
|
if (!(oclass->in_plugin->capabilities & CODEC_CAP_DELAY) ||
|
||||||
!GST_CLOCK_TIME_IS_VALID (ffmpegdec->next_ts)) &&
|
((ffmpegdec->picture->pict_type == FF_I_TYPE ||
|
||||||
GST_CLOCK_TIME_IS_VALID (*in_ts)) {
|
!GST_CLOCK_TIME_IS_VALID (ffmpegdec->next_ts)) &&
|
||||||
|
GST_CLOCK_TIME_IS_VALID (*in_ts))) {
|
||||||
ffmpegdec->next_ts = *in_ts;
|
ffmpegdec->next_ts = *in_ts;
|
||||||
|
*in_ts = GST_CLOCK_TIME_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = ffmpegdec->next_ts;
|
GST_BUFFER_TIMESTAMP (outbuf) = ffmpegdec->next_ts;
|
||||||
|
@ -738,12 +740,14 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
|
||||||
} else {
|
} else {
|
||||||
ffmpegdec->next_ts = GST_CLOCK_TIME_NONE;
|
ffmpegdec->next_ts = GST_CLOCK_TIME_NONE;
|
||||||
}
|
}
|
||||||
} else if (ffmpegdec->picture->pict_type != -1) {
|
} else if (ffmpegdec->picture->pict_type != -1 &&
|
||||||
|
oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
|
||||||
/* update time for skip-frame */
|
/* update time for skip-frame */
|
||||||
if ((ffmpegdec->picture->pict_type == FF_I_TYPE ||
|
if ((ffmpegdec->picture->pict_type == FF_I_TYPE ||
|
||||||
!GST_CLOCK_TIME_IS_VALID (ffmpegdec->next_ts)) &&
|
!GST_CLOCK_TIME_IS_VALID (ffmpegdec->next_ts)) &&
|
||||||
GST_CLOCK_TIME_IS_VALID (*in_ts)) {
|
GST_CLOCK_TIME_IS_VALID (*in_ts)) {
|
||||||
ffmpegdec->next_ts = *in_ts;
|
ffmpegdec->next_ts = *in_ts;
|
||||||
|
*in_ts = GST_CLOCK_TIME_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ffmpegdec->context->frame_rate_base != 0 &&
|
if (ffmpegdec->context->frame_rate_base != 0 &&
|
||||||
|
|
Loading…
Reference in a new issue