Index: ext/ffmpeg/gstffmpeg.c
===================================================================
RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpeg.c,v
retrieving revision 1.36
diff -u -p -r1.36 gstffmpeg.c
--- ext/ffmpeg/gstffmpeg.c	14 Dec 2006 23:31:45 -0000	1.36
+++ ext/ffmpeg/gstffmpeg.c	25 Apr 2007 10:00:10 -0000
@@ -63,6 +63,17 @@ gst_ffmpeg_avcodec_close (AVCodecContext
   return ret;
 }
 
+int
+gst_ffmpeg_av_find_stream_info(AVFormatContext *ic) {
+  int ret;
+
+  g_static_mutex_lock (&gst_avcodec_mutex);
+  ret = av_find_stream_info (ic);
+  g_static_mutex_unlock (&gst_avcodec_mutex);
+
+  return ret;
+}
+
 #ifndef GST_DISABLE_GST_DEBUG
 static void
 gst_ffmpeg_log_callback (void * ptr, int level, const char * fmt, va_list vl)
Index: ext/ffmpeg/gstffmpeg.h
===================================================================
RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpeg.h,v
retrieving revision 1.5
diff -u -p -r1.5 gstffmpeg.h
--- ext/ffmpeg/gstffmpeg.h	16 Dec 2005 16:23:05 -0000	1.5
+++ ext/ffmpeg/gstffmpeg.h	25 Apr 2007 10:00:10 -0000
@@ -53,6 +53,7 @@ extern gboolean gst_ffmpegdeinterlace_re
 
 int gst_ffmpeg_avcodec_open (AVCodecContext *avctx, AVCodec *codec);
 int gst_ffmpeg_avcodec_close (AVCodecContext *avctx);
+int gst_ffmpeg_av_find_stream_info(AVFormatContext *ic);
 
 G_END_DECLS
 
Index: ext/ffmpeg/gstffmpegdemux.c
===================================================================
RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdemux.c,v
retrieving revision 1.74
diff -u -p -r1.74 gstffmpegdemux.c
--- ext/ffmpeg/gstffmpegdemux.c	16 Feb 2007 11:48:15 -0000	1.74
+++ ext/ffmpeg/gstffmpegdemux.c	25 Apr 2007 10:00:10 -0000
@@ -1032,7 +1032,7 @@ gst_ffmpegdemux_open (GstFFMpegDemux * d
   if (res < 0)
     goto open_failed;
 
-  res = av_find_stream_info (demux->context);
+  res = gst_ffmpeg_av_find_stream_info (demux->context);
   GST_DEBUG_OBJECT (demux, "av_find_stream_info returned %d", res);
   if (res < 0)
     goto no_info;
