From 2539465ea11dea456e13c35b42729947cb1ccd02 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 11 Nov 2017 16:29:28 +0100 Subject: [PATCH 1/5] try to fix freeze with subtitle file , use gst_element_get_state only if need Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/4846492757738151c38874f0f9444484334ecbe6 Author: Jacek Jendrzej Date: 2017-11-11 (Sat, 11 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index a553ea2..2afc737 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -843,21 +843,23 @@ bool cPlayback::SetPosition(int position, bool absolute) { lt_info("%s: pos %d abs %d playing %d\n", __func__, position, absolute, playing); - gint64 time_nanoseconds; - gint64 pos; - GstFormat fmt = GST_FORMAT_TIME; - GstState state; if(m_gst_playbin) { - gst_element_get_state(m_gst_playbin, &state, NULL, GST_CLOCK_TIME_NONE); - - if ( (state == GST_STATE_PAUSED) && first) - { - init_jump = position; - first = false; - return false; + if(first){ + GstState state; + gst_element_get_state(m_gst_playbin, &state, NULL, GST_CLOCK_TIME_NONE); + if ( (state == GST_STATE_PAUSED) && first) + { + init_jump = position; + first = false; + return false; + } } + + gint64 time_nanoseconds; + gint64 pos; + GstFormat fmt = GST_FORMAT_TIME; if (!absolute) { gst_element_query_position(m_gst_playbin, fmt, &pos); From 4c59329d978e372616e3c678ed3c6b91b863f133 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 11 Nov 2017 16:52:38 +0100 Subject: [PATCH 2/5] return false in decoder have no time Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/72579547e36fc23f78bfd127e680f91b40d4c8c2 Author: Jacek Jendrzej Date: 2017-11-11 (Sat, 11 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 2afc737..2b8202d 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -815,12 +815,16 @@ bool cPlayback::GetPosition(int &position, int &duration) if (!GST_CLOCK_TIME_IS_VALID(pts)) { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); + return false; } } else { if(!gst_element_query_position(m_gst_playbin, fmt, &pts)) + { lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__); + return false; + } } position = pts / 1000000.0; // duration From 9ed727e7b464f9191f479087fbdf7b1e84a5083e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 11 Nov 2017 16:55:02 +0100 Subject: [PATCH 3/5] check if tag is gst list Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/93fc10c8e95a7a79f755415bc99531e47408a728 Author: Jacek Jendrzej Date: 2017-11-11 (Sat, 11 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 2b8202d..e13a6d1 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -250,9 +250,12 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) case GST_MESSAGE_TAG: { - GstTagList *tags, *result; + GstTagList *tags = NULL, *result = NULL; gst_message_parse_tag(msg, &tags); + if(tags != NULL || !GST_IS_TAG_LIST(tags)) + break; + result = gst_tag_list_merge(m_stream_tags, tags, GST_TAG_MERGE_REPLACE); if (result) { From b75c67db532bdca94c24d4a303977194f307c63b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 11 Nov 2017 17:08:51 +0100 Subject: [PATCH 4/5] fix last commit, broken check logic Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/745959abf644b718f7c26527902e6c92cc85e762 Author: Jacek Jendrzej Date: 2017-11-11 (Sat, 11 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index e13a6d1..3c7317a 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -253,7 +253,9 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) GstTagList *tags = NULL, *result = NULL; gst_message_parse_tag(msg, &tags); - if(tags != NULL || !GST_IS_TAG_LIST(tags)) + if(tags == NULL) + break; + if(!GST_IS_TAG_LIST(tags)) break; result = gst_tag_list_merge(m_stream_tags, tags, GST_TAG_MERGE_REPLACE); From ce9bbe1248da80477e09716f2b645dd30b91e4fd Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 10 Nov 2017 16:17:40 +0100 Subject: [PATCH 5/5] move gchar * sourceName = gst_object_get_name(source); Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/f9daec20902cb27a2934be24db3a58230e6eb44d Author: Jacek Jendrzej Date: 2017-11-10 (Fri, 10 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 3c7317a..0de0930 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -188,8 +188,6 @@ void playbinNotifySource(GObject *object, GParamSpec *param_spec, gpointer user_ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) { - gchar * sourceName; - // source GstObject * source; source = GST_MESSAGE_SRC(msg); @@ -197,8 +195,6 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) if (!GST_IS_OBJECT(source)) return GST_BUS_DROP; - sourceName = gst_object_get_name(source); - switch (GST_MESSAGE_TYPE(msg)) { case GST_MESSAGE_EOS: @@ -214,6 +210,7 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) GError *err; gst_message_parse_error(msg, &err, &debug); g_free (debug); + gchar * sourceName = gst_object_get_name(source); lt_info_c( "%s:%s - GST_MESSAGE_ERROR: %s (%i) from %s\n", FILENAME, __FUNCTION__, err->message, err->code, sourceName ); if ( err->domain == GST_STREAM_ERROR ) { @@ -226,6 +223,8 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) } } g_error_free(err); + if(sourceName) + g_free(sourceName); end_eof = 1; // NOTE: just to exit @@ -241,8 +240,12 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) g_free (debug); if ( inf->domain == GST_STREAM_ERROR && inf->code == GST_STREAM_ERROR_DECODE ) { + gchar * sourceName = gst_object_get_name(source); if ( g_strrstr(sourceName, "videosink") ) lt_info_c( "%s:%s - GST_MESSAGE_INFO: videosink\n", FILENAME, __FUNCTION__ ); //FIXME: how shall playback handle this event??? + if(sourceName) + g_free(sourceName); + } g_error_free(inf); break; @@ -393,8 +396,6 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) default: break; } - if(sourceName) - g_free(sourceName); return GST_BUS_DROP; }