ext/ffmpeg/gstffmpegdec.c: Remove GST_STREAM_LOCK here, it is not needed any longer.
authorTim-Philipp Müller <tim@centricular.net>
Mon, 21 Nov 2005 18:26:23 +0000 (18:26 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Mon, 21 Nov 2005 18:26:23 +0000 (18:26 +0000)
Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_sink_event):
Remove GST_STREAM_LOCK here, it is not needed any longer.

ChangeLog
ext/ffmpeg/gstffmpegdec.c

index e34a3b1..02ae605 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-21  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_sink_event):
+         Remove GST_STREAM_LOCK here, it is not needed any longer.
+
 2005-11-16  Luca Ognibene  <luogni@tin.it>
 
        * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_get_buffer):
index 429f707..a71610d 100644 (file)
@@ -605,7 +605,7 @@ gst_ffmpegdec_release_buffer (AVCodecContext * context, AVFrame * picture)
   gint i;
   GstBuffer *buf;
   GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) context->opaque;
-  
+
   g_return_if_fail (buf != NULL);
   g_return_if_fail (picture->type == FF_BUFFER_TYPE_USER);
 
@@ -614,7 +614,7 @@ gst_ffmpegdec_release_buffer (AVCodecContext * context, AVFrame * picture)
   if (buf == ffmpegdec->last_buffer)
     ffmpegdec->last_buffer = NULL;
   gst_buffer_unref (buf);
-  
+
   picture->opaque = NULL;
 
   /* zero out the reference in ffmpeg */
@@ -772,12 +772,12 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
               "Dropping frame for synctime %" GST_TIME_FORMAT
               ", expected(next_ts) %" GST_TIME_FORMAT,
               GST_TIME_ARGS (ffmpegdec->synctime),
-              GST_TIME_ARGS (ffmpegdec->next_ts));       
+              GST_TIME_ARGS (ffmpegdec->next_ts));
 
-         if (ffmpegdec->picture->opaque != NULL) {
-           outbuf = (GstBuffer *) ffmpegdec->picture->opaque;
-           gst_buffer_unref (outbuf);
-         }
+          if (ffmpegdec->picture->opaque != NULL) {
+            outbuf = (GstBuffer *) ffmpegdec->picture->opaque;
+            gst_buffer_unref (outbuf);
+          }
 
           have_data = 0;
           /* don´t break here! Timestamps are updated below */
@@ -958,7 +958,6 @@ gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event)
   GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) GST_OBJECT_PARENT (pad);
   GstFFMpegDecClass *oclass =
       (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
-  gboolean unlock = FALSE;
   gboolean ret;
 
   GST_DEBUG_OBJECT (ffmpegdec, "Handling %s event",
@@ -966,9 +965,6 @@ gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event)
 
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_EOS:{
-      GST_STREAM_LOCK (pad);
-      unlock = TRUE;
-
       if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
         gint have_data, len, try = 0;
 
@@ -983,15 +979,7 @@ gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event)
       }
       break;
     }
-    case GST_EVENT_TAG:{
-      GST_STREAM_LOCK (pad);
-      unlock = TRUE;
-      break;
-    }
     case GST_EVENT_FLUSH_STOP:{
-      GST_STREAM_LOCK (pad);
-      unlock = TRUE;
-
       if (ffmpegdec->opened) {
         avcodec_flush_buffers (ffmpegdec->context);
       }
@@ -1002,9 +990,6 @@ gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event)
       gdouble rate;
       GstFormat fmt;
 
-      GST_STREAM_LOCK (pad);
-      unlock = TRUE;
-
       gst_event_parse_newsegment (event, NULL, &rate, &fmt, &start, &end,
           &base);
       if (fmt == GST_FORMAT_TIME) {
@@ -1049,9 +1034,6 @@ gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event)
 
   ret = gst_pad_event_default (ffmpegdec->sinkpad, event);
 
-  if (unlock)
-    GST_STREAM_UNLOCK (pad);
-
   return ret;
 }