mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
ext/ffmpeg/gstffmpegdec.c (struct _GstFFMpegDec)
Original commit message from CVS: * ext/ffmpeg/gstffmpegdec.c (struct _GstFFMpegDec) (gst_ffmpegdec_open, gst_ffmpegdec_negotiate): Cache the pixel format value and renegotiate the pipeline if this value changes. Fixes segfault when decoding a stream with different colorspaces like a sequence of jpeg.
This commit is contained in:
parent
5f377234f5
commit
53f3d5be33
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
2005-07-11 Luca Ognibene <luogni@tin.it>
|
||||
|
||||
* ext/ffmpeg/gstffmpegdec.c (struct _GstFFMpegDec)
|
||||
(gst_ffmpegdec_open, gst_ffmpegdec_negotiate):
|
||||
Cache the pixel format value and renegotiate the pipeline
|
||||
if this value changes. Fixes segfault when decoding a
|
||||
stream with different colorspaces like a sequence of jpeg.
|
||||
|
||||
2005-07-11 daniel fischer <dan@f3c.com>
|
||||
|
||||
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
|
|
@ -54,6 +54,7 @@ struct _GstFFMpegDec
|
|||
union {
|
||||
struct {
|
||||
gint width, height, fps, fps_base;
|
||||
enum PixelFormat pix_fmt;
|
||||
} video;
|
||||
struct {
|
||||
gint channels, samplerate;
|
||||
|
@ -414,6 +415,7 @@ gst_ffmpegdec_open (GstFFMpegDec *ffmpegdec)
|
|||
ffmpegdec->format.video.height = 0;
|
||||
ffmpegdec->format.video.fps = 0;
|
||||
ffmpegdec->format.video.fps_base = 0;
|
||||
ffmpegdec->format.video.pix_fmt = PIX_FMT_NB;
|
||||
break;
|
||||
case CODEC_TYPE_AUDIO:
|
||||
ffmpegdec->format.audio.samplerate = 0;
|
||||
|
@ -583,7 +585,8 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec)
|
|||
ffmpegdec->format.video.height == ffmpegdec->context->height &&
|
||||
ffmpegdec->format.video.fps == ffmpegdec->context->frame_rate &&
|
||||
ffmpegdec->format.video.fps_base ==
|
||||
ffmpegdec->context->frame_rate_base)
|
||||
ffmpegdec->context->frame_rate_base &&
|
||||
ffmpegdec->format.video.pix_fmt == ffmpegdec->context->pix_fmt)
|
||||
return TRUE;
|
||||
GST_DEBUG ("Renegotiating video from %dx%d@%d/%dfps to %dx%d@%d/%dfps",
|
||||
ffmpegdec->format.video.width, ffmpegdec->format.video.height,
|
||||
|
@ -594,6 +597,7 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec)
|
|||
ffmpegdec->format.video.height = ffmpegdec->context->height;
|
||||
ffmpegdec->format.video.fps = ffmpegdec->context->frame_rate;
|
||||
ffmpegdec->format.video.fps_base = ffmpegdec->context->frame_rate_base;
|
||||
ffmpegdec->format.video.pix_fmt = ffmpegdec->context->pix_fmt;
|
||||
break;
|
||||
case CODEC_TYPE_AUDIO:
|
||||
if (ffmpegdec->format.audio.samplerate ==
|
||||
|
|
Loading…
Reference in a new issue