diff options
author | Edward Hervey <bilboed@bilboed.com> | 2007-05-09 15:30:51 +0000 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2007-05-09 15:30:51 +0000 |
commit | cc9a75adcb3bd50fe376d8185944f85a43332a4f (patch) | |
tree | b43ad3c29e6d37368a4d279678b508e41b0c3812 | |
parent | 0fcacdde8c5ee4d6cd5994bb467982039c601a6b (diff) |
ext/ffmpeg/: Protect calls to ffmpeg functions that will implicitly call avcodec_open/close with the avcodec mutex.
Original commit message from CVS:
* ext/ffmpeg/gstffmpeg.c: (gst_ffmpeg_av_find_stream_info):
* ext/ffmpeg/gstffmpeg.h:
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_open):
Protect calls to ffmpeg functions that will implicitly call
avcodec_open/close with the avcodec mutex.
Fixes #433245
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | ext/ffmpeg/gstffmpeg.c | 11 | ||||
-rw-r--r-- | ext/ffmpeg/gstffmpeg.h | 1 | ||||
-rw-r--r-- | ext/ffmpeg/gstffmpegdemux.c | 2 |
4 files changed, 22 insertions, 1 deletions
@@ -1,3 +1,12 @@ +2007-05-09 Edward Hervey <edward@fluendo.com> + + * ext/ffmpeg/gstffmpeg.c: (gst_ffmpeg_av_find_stream_info): + * ext/ffmpeg/gstffmpeg.h: + * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_open): + Protect calls to ffmpeg functions that will implicitly call + avcodec_open/close with the avcodec mutex. + Fixes #433245 + 2007-05-02 Edward Hervey <edward@fluendo.com> * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_init), diff --git a/ext/ffmpeg/gstffmpeg.c b/ext/ffmpeg/gstffmpeg.c index 6c74db2..3430847 100644 --- a/ext/ffmpeg/gstffmpeg.c +++ b/ext/ffmpeg/gstffmpeg.c @@ -63,6 +63,17 @@ gst_ffmpeg_avcodec_close (AVCodecContext *avctx) { 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) diff --git a/ext/ffmpeg/gstffmpeg.h b/ext/ffmpeg/gstffmpeg.h index 50ebc37..e0f1c90 100644 --- a/ext/ffmpeg/gstffmpeg.h +++ b/ext/ffmpeg/gstffmpeg.h @@ -53,6 +53,7 @@ extern gboolean gst_ffmpegdeinterlace_register (GstPlugin * plugin); 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 diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index d780e45..c85f9c0 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -1032,7 +1032,7 @@ gst_ffmpegdemux_open (GstFFMpegDemux * demux) 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; |