oggdemux: port to new GLib thread API

This commit is contained in:
Tim-Philipp Müller 2012-09-10 01:08:51 +01:00
parent 794af4fc51
commit 5bb8021fc9
2 changed files with 10 additions and 10 deletions

View File

@ -61,19 +61,19 @@
#define GST_FLOW_LIMIT GST_FLOW_CUSTOM_ERROR #define GST_FLOW_LIMIT GST_FLOW_CUSTOM_ERROR
#define GST_FLOW_SKIP_PUSH GST_FLOW_CUSTOM_SUCCESS_1 #define GST_FLOW_SKIP_PUSH GST_FLOW_CUSTOM_SUCCESS_1
#define GST_CHAIN_LOCK(ogg) g_mutex_lock((ogg)->chain_lock) #define GST_CHAIN_LOCK(ogg) g_mutex_lock(&(ogg)->chain_lock)
#define GST_CHAIN_UNLOCK(ogg) g_mutex_unlock((ogg)->chain_lock) #define GST_CHAIN_UNLOCK(ogg) g_mutex_unlock(&(ogg)->chain_lock)
#define GST_PUSH_LOCK(ogg) \ #define GST_PUSH_LOCK(ogg) \
do { \ do { \
GST_TRACE_OBJECT(ogg, "Push lock"); \ GST_TRACE_OBJECT(ogg, "Push lock"); \
g_mutex_lock((ogg)->push_lock); \ g_mutex_lock(&(ogg)->push_lock); \
} while(0) } while(0)
#define GST_PUSH_UNLOCK(ogg) \ #define GST_PUSH_UNLOCK(ogg) \
do { \ do { \
GST_TRACE_OBJECT(ogg, "Push unlock"); \ GST_TRACE_OBJECT(ogg, "Push unlock"); \
g_mutex_unlock((ogg)->push_lock); \ g_mutex_unlock(&(ogg)->push_lock); \
} while(0) } while(0)
GST_DEBUG_CATEGORY (gst_ogg_demux_debug); GST_DEBUG_CATEGORY (gst_ogg_demux_debug);
@ -2019,8 +2019,8 @@ gst_ogg_demux_init (GstOggDemux * ogg)
gst_ogg_demux_sink_activate_mode); gst_ogg_demux_sink_activate_mode);
gst_element_add_pad (GST_ELEMENT (ogg), ogg->sinkpad); gst_element_add_pad (GST_ELEMENT (ogg), ogg->sinkpad);
ogg->chain_lock = g_mutex_new (); g_mutex_init (&ogg->chain_lock);
ogg->push_lock = g_mutex_new (); g_mutex_init (&ogg->push_lock);
ogg->chains = g_array_new (FALSE, TRUE, sizeof (GstOggChain *)); ogg->chains = g_array_new (FALSE, TRUE, sizeof (GstOggChain *));
ogg->stats_nbisections = 0; ogg->stats_nbisections = 0;
@ -2040,8 +2040,8 @@ gst_ogg_demux_finalize (GObject * object)
ogg = GST_OGG_DEMUX (object); ogg = GST_OGG_DEMUX (object);
g_array_free (ogg->chains, TRUE); g_array_free (ogg->chains, TRUE);
g_mutex_free (ogg->chain_lock); g_mutex_clear (&ogg->chain_lock);
g_mutex_free (ogg->push_lock); g_mutex_clear (&ogg->push_lock);
ogg_sync_clear (&ogg->sync); ogg_sync_clear (&ogg->sync);
if (ogg->newsegment) if (ogg->newsegment)

View File

@ -142,7 +142,7 @@ struct _GstOggDemux
guint64 max_packet_size, max_page_size; guint64 max_packet_size, max_page_size;
/* state */ /* state */
GMutex *chain_lock; /* we need the lock to protect the chains */ GMutex chain_lock; /* we need the lock to protect the chains */
GArray *chains; /* list of chains we know */ GArray *chains; /* list of chains we know */
GstClockTime total_time; GstClockTime total_time;
gint bitrate; /* bitrate of the current chain */ gint bitrate; /* bitrate of the current chain */
@ -162,7 +162,7 @@ struct _GstOggDemux
gint64 prestime; gint64 prestime;
/* push mode seeking support */ /* push mode seeking support */
GMutex *push_lock; /* we need the lock to protect the push mode variables */ GMutex push_lock; /* we need the lock to protect the push mode variables */
gint64 push_byte_offset; /* where were are at in the stream, in bytes */ gint64 push_byte_offset; /* where were are at in the stream, in bytes */
gint64 push_byte_length; /* length in bytes of the stream, -1 if unknown */ gint64 push_byte_length; /* length in bytes of the stream, -1 if unknown */
GstClockTime push_time_length; /* length in time of the stream */ GstClockTime push_time_length; /* length in time of the stream */