codecanalyzer: Use glib variant of strcmp

safer, and avoids missing include
This commit is contained in:
Jimmy Ohn 2019-04-01 21:49:19 +09:00
parent 6754d4e9f2
commit 1858853bf2
3 changed files with 4 additions and 4 deletions

View file

@ -221,7 +221,7 @@ populate_notebook (gpointer data, gpointer user_data)
notebook = (GtkWidget *) user_data;
header_name = (gchar *) data;
if (strcmp (header_name, "comment")) {
if (g_strcmp0 (header_name, "comment")) {
header = gtk_label_new (header_name);
gtk_label_set_text (GTK_LABEL (header), header_name);
@ -304,7 +304,7 @@ callback_button_box_click (GtkWidget * widget, GdkEvent * event,
header_list = analyzer_get_list_header_strings (xml_name);
while (header_list) {
if (strcmp (header_list->data, "comment")) {
if (g_strcmp0 (header_list->data, "comment")) {
if (is_header && !g_str_has_prefix (header_list->data, "slice"))
hlist = g_list_append (hlist, header_list->data);
else if (is_slice && g_str_has_prefix (header_list->data, "slice"))

View file

@ -310,7 +310,7 @@ gst_analyzer_init (GstAnalyzer * analyzer, char *uri)
g_signal_connect (analyzer->sink, "new-frame", (GCallback) new_frame_callback,
analyzer);
if (!strcmp (analyzer->codec_name, "mpeg2"))
if (!g_strcmp0 (analyzer->codec_name, "mpeg2"))
g_object_set (G_OBJECT (analyzer->parser), "drop", FALSE, NULL);
gst_bin_add_many (GST_BIN (analyzer->pipeline), analyzer->src,

View file

@ -182,7 +182,7 @@ gst_analyzer_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
structure = gst_caps_get_structure (caps, 0);
const gchar *name = gst_structure_get_name (structure);
if (!strcmp (name, "video/mpeg"))
if (!g_strcmp0 (name, "video/mpeg"))
sink->codec_type = GST_ANALYZER_CODEC_MPEG2_VIDEO;
else
return FALSE;