Revert "tsbase: add a guard with an atomic boolean when flushing"

This reverts commit e14e310f71.

Would be better move the packetizer flushing to FLUSH_STOP and avoid
the race that way. Without introducing a memory barrier that could
have impact in the performance.
This commit is contained in:
Josep Torra 2012-11-10 19:46:40 +01:00
parent 51c4f255be
commit 80dd130fb0
2 changed files with 0 additions and 13 deletions

View file

@ -1362,7 +1362,6 @@ mpegts_base_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
gst_event_unref (event);
break;
case GST_EVENT_FLUSH_START:
MPEGTSBASE_SET_FLUSHING (base, TRUE);
mpegts_packetizer_flush (base->packetizer);
mpegts_base_flush (base);
res = GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, event);
@ -1370,9 +1369,6 @@ mpegts_base_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
case GST_EVENT_FLUSH_STOP:
gst_segment_init (&base->segment, GST_FORMAT_UNDEFINED);
base->seen_pat = FALSE;
res = GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, event);
MPEGTSBASE_SET_FLUSHING (base, FALSE);
break;
/* Passthrough */
default:
res = GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, event);
@ -1403,11 +1399,6 @@ mpegts_base_push (MpegTSBase * base, MpegTSPacketizerPacket * packet,
{
MpegTSBaseClass *klass = GST_MPEGTS_BASE_GET_CLASS (base);
if (G_UNLIKELY (MPEGTSBASE_IS_FLUSHING (base))) {
GST_LOG_OBJECT (base, "Dropping because flushing");
return GST_FLOW_FLUSHING;
}
/* Call implementation */
if (G_UNLIKELY (klass->push == NULL)) {
GST_ERROR_OBJECT (base, "Class doesn't have a 'push' implementation !");

View file

@ -119,7 +119,6 @@ struct _MpegTSBase {
guint8 *is_pes;
gboolean disposed;
gboolean flushing; /* ATOMIC */
/* size of the MpegTSBaseProgram structure, can be overridden
* by subclasses if they have their own MpegTSBaseProgram subclasses. */
@ -184,9 +183,6 @@ struct _MpegTSBaseClass {
#define MPEGTS_BIT_UNSET(field, offs) ((field)[(offs) >> 3] &= ~(1 << ((offs) & 0x7)))
#define MPEGTS_BIT_IS_SET(field, offs) ((field)[(offs) >> 3] & (1 << ((offs) & 0x7)))
#define MPEGTSBASE_IS_FLUSHING(self) (g_atomic_int_get (&((self)->flushing)))
#define MPEGTSBASE_SET_FLUSHING(self,state) (g_atomic_int_set (&((self)->flushing),state))
G_GNUC_INTERNAL GType mpegts_base_get_type(void);
G_GNUC_INTERNAL MpegTSBaseProgram *mpegts_base_get_program (MpegTSBase * base, gint program_number);