summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2002-12-28 00:11:56 +0000
committerWim Taymans <wim.taymans@gmail.com>2002-12-28 00:11:56 +0000
commit631ae96d59d146adcc3fafb19dd080b62e4cd955 (patch)
treea8a44c211b7fc5e3684f8e7d02518dda9a8cf3c7
parent63c54e235000691fcd8ca7d99d04ac55ee7b1f92 (diff)
downloadgst-libav-631ae96d59d146adcc3fafb19dd080b62e4cd955.tar.gz
Fix for latest ffmpeg
Original commit message from CVS: Fix for latest ffmpeg
-rw-r--r--ext/ffmpeg/gstffmpegdec.c4
-rw-r--r--ext/ffmpeg/gstffmpegenc.c2
-rw-r--r--ext/ffmpeg/gstffmpegmux.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index 28d2dda..4c51641 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -172,10 +172,12 @@ gst_ffmpegdec_sinkconnect (GstPad *pad, GstCaps *caps)
ffmpegdec->context->bit_rate = 0;
/* FIXME bug in ffmpeg */
+ /*
if (avcodec_open (ffmpegdec->context, avcodec_find_encoder(CODEC_ID_MPEG1VIDEO)) <0 ) {
g_warning ("ffmpegdec: could not open codec");
return GST_PAD_CONNECT_REFUSED;
}
+ */
if (avcodec_open (ffmpegdec->context, oclass->in_plugin) < 0) {
g_warning ("ffmpegdec: could not open codec");
@@ -189,7 +191,7 @@ gst_ffmpegdec_init(GstFFMpegDec *ffmpegdec)
{
GstFFMpegDecClass *oclass = (GstFFMpegDecClass*)(G_OBJECT_GET_CLASS (ffmpegdec));
- ffmpegdec->context = g_malloc0 (sizeof (AVCodecContext));
+ ffmpegdec->context = avcodec_alloc_context();
ffmpegdec->sinkpad = gst_pad_new_from_template (oclass->templ, "sink");
gst_pad_set_connect_function (ffmpegdec->sinkpad, gst_ffmpegdec_sinkconnect);
diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c
index 9dc6795..196290e 100644
--- a/ext/ffmpeg/gstffmpegenc.c
+++ b/ext/ffmpeg/gstffmpegenc.c
@@ -285,7 +285,7 @@ gst_ffmpegenc_init(GstFFMpegEnc *ffmpegenc)
{
GstFFMpegEncClass *oclass = (GstFFMpegEncClass*)(G_OBJECT_GET_CLASS (ffmpegenc));
- ffmpegenc->context = g_malloc0 (sizeof (AVCodecContext));
+ ffmpegenc->context = avcodec_alloc_context();
if (oclass->in_plugin->type == CODEC_TYPE_VIDEO) {
ffmpegenc->sinkpad = gst_pad_new_from_template (
diff --git a/ext/ffmpeg/gstffmpegmux.c b/ext/ffmpeg/gstffmpegmux.c
index ba4cac1..261de4d 100644
--- a/ext/ffmpeg/gstffmpegmux.c
+++ b/ext/ffmpeg/gstffmpegmux.c
@@ -193,7 +193,7 @@ gst_ffmpegmux_init(GstFFMpegMux *ffmpegmux)
{
GstFFMpegMuxClass *oclass = (GstFFMpegMuxClass*)(G_OBJECT_GET_CLASS (ffmpegmux));
- ffmpegmux->context = g_malloc0 (sizeof (AVCodecContext));
+ ffmpegmux->context = avcodec_alloc_context();
ffmpegmux->sinkpad = gst_pad_new_from_template (
GST_PAD_TEMPLATE_GET (gst_ffmpegmux_sink_factory), "sink");