libarmbox/playback_gst.cpp: minor format changes

This commit is contained in:
2018-01-21 13:52:58 +01:00
parent 0ad071c97b
commit 4ecbe7733b

View File

@@ -354,8 +354,6 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
gst_object_unref(GST_OBJECT(videoSink)); gst_object_unref(GST_OBJECT(videoSink));
videoSink = NULL; videoSink = NULL;
} }
// set audio sink
children = gst_bin_iterate_recurse(GST_BIN(m_gst_playbin)); children = gst_bin_iterate_recurse(GST_BIN(m_gst_playbin));
if (children && gst_iterator_find_custom(children, (GCompareFunc)match_sinktype, &r, (gpointer)"GstDVBAudioSink")) if (children && gst_iterator_find_custom(children, (GCompareFunc)match_sinktype, &r, (gpointer)"GstDVBAudioSink"))
{ {
@@ -365,8 +363,6 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
} }
gst_iterator_free(children); gst_iterator_free(children);
// set video sink
children = gst_bin_iterate_recurse(GST_BIN(m_gst_playbin)); children = gst_bin_iterate_recurse(GST_BIN(m_gst_playbin));
if (children && gst_iterator_find_custom(children, (GCompareFunc)match_sinktype, &r, (gpointer)"GstDVBVideoSink")) if (children && gst_iterator_find_custom(children, (GCompareFunc)match_sinktype, &r, (gpointer)"GstDVBVideoSink"))
{ {
@@ -374,10 +370,7 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
g_value_unset (&r); g_value_unset (&r);
lt_info_c( "%s %s - video sink created\n", FILENAME, __FUNCTION__); lt_info_c( "%s %s - video sink created\n", FILENAME, __FUNCTION__);
} }
gst_iterator_free(children); gst_iterator_free(children);
}
break;
} }
break; break;
@@ -415,13 +408,13 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
return GST_BUS_DROP; return GST_BUS_DROP;
} }
cPlayback::cPlayback(int num) cPlayback::cPlayback(int num)
{ {
lt_info( "%s:%s\n", FILENAME, __FUNCTION__); lt_info( "%s:%s\n", FILENAME, __FUNCTION__);
const gchar *nano_str; const gchar *nano_str;
guint major, minor, micro, nano; guint major, minor, micro, nano;
/* init gstreamer */
gst_init(NULL, NULL); gst_init(NULL, NULL);
gst_version (&major, &minor, &micro, &nano); gst_version (&major, &minor, &micro, &nano);
@@ -450,14 +443,13 @@ cPlayback::cPlayback(int num)
first = false; first = false;
} }
/* called at housekepping */
cPlayback::~cPlayback() cPlayback::~cPlayback()
{ {
lt_info( "%s:%s\n", FILENAME, __FUNCTION__); lt_info( "%s:%s\n", FILENAME, __FUNCTION__);
//FIXME: all deleting stuff is done in Close() //FIXME: all deleting stuff is done in Close()
pthread_mutex_lock (&mutex_tag_ist); pthread_mutex_lock (&mutex_tag_ist);
if (m_stream_tags) if (m_stream_tags)
gst_tag_list_free(m_stream_tags); gst_tag_list_unref(m_stream_tags);
pthread_mutex_unlock (&mutex_tag_ist); pthread_mutex_unlock (&mutex_tag_ist);
} }
@@ -619,14 +611,12 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/,
flags |= GST_PLAY_FLAG_BUFFERING; flags |= GST_PLAY_FLAG_BUFFERING;
} }
// set flags
g_object_set(G_OBJECT (m_gst_playbin), "flags", flags, NULL); g_object_set(G_OBJECT (m_gst_playbin), "flags", flags, NULL);
// set uri
g_object_set(G_OBJECT (m_gst_playbin), "uri", uri, NULL); g_object_set(G_OBJECT (m_gst_playbin), "uri", uri, NULL);
//gstbus handler //gstbus handler
GstBus * bus = gst_pipeline_get_bus(GST_PIPELINE(m_gst_playbin)); GstBus * bus = gst_pipeline_get_bus( GST_PIPELINE(m_gst_playbin) );
gst_bus_set_sync_handler(bus, Gst_bus_call, NULL, NULL); gst_bus_set_sync_handler(bus, Gst_bus_call, NULL, NULL);
if (bus) if (bus)
gst_object_unref(bus); gst_object_unref(bus);
@@ -683,7 +673,6 @@ bool cPlayback::Stop(void)
{ {
if(playing == false) if(playing == false)
return false; return false;
lt_info( "%s:%s playing %d\n", FILENAME, __FUNCTION__, playing); lt_info( "%s:%s playing %d\n", FILENAME, __FUNCTION__, playing);
// stop // stop
@@ -1008,7 +997,7 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu
gst_tag_list_free(tags); gst_tag_list_free(tags);
} }
} }
*numpida = i; *numpida=i;
} }
} }