From: Alfred Agrell floating@muncher.se
--- dlls/winegstreamer/unixlib.c | 9 +-------- dlls/winegstreamer/wg_format.c | 11 ++++------- dlls/winegstreamer/wg_parser.c | 27 ++++++++++----------------- dlls/winegstreamer/wg_transform.c | 10 ++-------- 4 files changed, 17 insertions(+), 40 deletions(-)
diff --git a/dlls/winegstreamer/unixlib.c b/dlls/winegstreamer/unixlib.c index 513ece95a90..46f2c79da4d 100644 --- a/dlls/winegstreamer/unixlib.c +++ b/dlls/winegstreamer/unixlib.c @@ -124,16 +124,9 @@ GstElement *find_element(GstElementFactoryListType type, GstCaps *src_caps, GstC
done: if (element) - { GST_DEBUG("Created %s element %p.", name, element); - } else - { - gchar *src_str = gst_caps_to_string(src_caps), *sink_str = gst_caps_to_string(sink_caps); - GST_WARNING("Failed to create element matching caps %s / %s.", src_str, sink_str); - g_free(sink_str); - g_free(src_str); - } + GST_WARNING("Failed to create element matching caps %" GST_PTR_FORMAT " / %" GST_PTR_FORMAT ".", src_caps, sink_caps);
return element; } diff --git a/dlls/winegstreamer/wg_format.c b/dlls/winegstreamer/wg_format.c index 743f674bcd6..d8a580b0197 100644 --- a/dlls/winegstreamer/wg_format.c +++ b/dlls/winegstreamer/wg_format.c @@ -181,17 +181,17 @@ static void wg_format_from_caps_audio_mpeg1(struct wg_format *format, const GstC
if (!gst_structure_get_int(structure, "layer", &layer)) { - GST_WARNING("Missing "layer" value."); + GST_WARNING("Missing "layer" value in %" GST_PTR_FORMAT ".", caps); return; } if (!gst_structure_get_int(structure, "channels", &channels)) { - GST_WARNING("Missing "channels" value."); + GST_WARNING("Missing "channels" value in %" GST_PTR_FORMAT ".", caps); return; } if (!gst_structure_get_int(structure, "rate", &rate)) { - GST_WARNING("Missing "rate" value."); + GST_WARNING("Missing "rate" value in %" GST_PTR_FORMAT ".", caps); return; }
@@ -318,10 +318,7 @@ void wg_format_from_caps(struct wg_format *format, const GstCaps *caps) } else { - gchar *str = gst_caps_to_string(caps); - - GST_FIXME("Unhandled caps %s.", str); - g_free(str); + GST_FIXME("Unhandled caps %" GST_PTR_FORMAT ".", caps); } }
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 8231c26a5b6..4b585425c3e 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -456,7 +456,7 @@ static NTSTATUS wg_parser_stream_seek(void *args) if (!push_event(stream->my_sink, gst_event_new_seek(params->rate, GST_FORMAT_TIME, flags, start_type, params->start_pos * 100, stop_type, params->stop_pos == stream->duration ? -1 : params->stop_pos * 100))) - GST_ERROR("Failed to seek.\n"); + GST_ERROR("Failed to seek.");
return S_OK; } @@ -480,13 +480,12 @@ static NTSTATUS wg_parser_stream_notify_qos(void *args) /* This can happen legitimately if the sample falls outside of the * segment bounds. GStreamer elements shouldn't present the sample in * that case, but DirectShow doesn't care. */ - GST_LOG("Ignoring QoS event.\n"); + GST_LOG("Ignoring QoS event."); return S_OK; } - if (!(event = gst_event_new_qos(params->underflow ? GST_QOS_TYPE_UNDERFLOW : GST_QOS_TYPE_OVERFLOW, params->proportion, diff, stream_time))) - GST_ERROR("Failed to create QOS event.\n"); + GST_ERROR("Failed to create QOS event."); push_event(stream->my_sink, event);
return S_OK; @@ -679,6 +678,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu
if (!stream->enabled) { + GST_LOG("Stream is disabled; discarding buffer."); pthread_mutex_unlock(&parser->mutex); gst_buffer_unref(buffer); return GST_FLOW_OK; @@ -695,7 +695,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu if (!gst_buffer_map(buffer, &stream->map_info, GST_MAP_READ)) { pthread_mutex_unlock(&parser->mutex); - GST_ERROR("Failed to map buffer.\n"); + GST_ERROR("Failed to map buffer."); gst_buffer_unref(buffer); return GST_FLOW_ERROR; } @@ -725,7 +725,6 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) case GST_QUERY_CAPS: { GstCaps *caps, *filter, *temp; - gchar *str; gsize i;
gst_query_parse_caps(query, &filter); @@ -742,9 +741,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) gst_structure_remove_fields(gst_caps_get_structure(caps, i), "framerate", "pixel-aspect-ratio", NULL);
- str = gst_caps_to_string(caps); - GST_LOG("Stream caps are "%s".", str); - g_free(str); + GST_LOG("Stream caps are "%" GST_PTR_FORMAT "".", caps);
if (filter) { @@ -779,12 +776,8 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query)
pthread_mutex_unlock(&parser->mutex);
- if (!ret && gst_debug_category_get_threshold(GST_CAT_DEFAULT) >= GST_LEVEL_WARNING) - { - gchar *str = gst_caps_to_string(caps); - GST_WARNING("Rejecting caps "%s".", str); - g_free(str); - } + if (!ret) + GST_WARNING("Rejecting caps "%" GST_PTR_FORMAT "".", caps); gst_query_set_accept_caps_result(query, ret); return TRUE; } @@ -1588,7 +1581,7 @@ static NTSTATUS wg_parser_connect(void *args) ret = gst_element_get_state(parser->container, NULL, NULL, -1); if (ret == GST_STATE_CHANGE_FAILURE) { - GST_ERROR("Failed to play stream.\n"); + GST_ERROR("Failed to play stream."); goto out; }
@@ -1651,7 +1644,7 @@ static NTSTATUS wg_parser_connect(void *args) if (stream->eos) { stream->duration = 0; - GST_WARNING("Failed to query duration.\n"); + GST_WARNING("Failed to query duration."); break; }
diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index e2b14527a20..d033ff27f43 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -196,7 +196,6 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery case GST_QUERY_CAPS: { GstCaps *caps, *filter, *temp; - gchar *str;
gst_query_parse_caps(query, &filter); if (!(caps = wg_format_to_caps(&transform->output_format))) @@ -209,9 +208,7 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery caps = temp; }
- str = gst_caps_to_string(caps); - GST_INFO("Returning caps %s", str); - g_free(str); + GST_INFO("Returning caps %" GST_PTR_FORMAT, caps);
gst_query_set_caps_result(query, caps); gst_caps_unref(caps); @@ -498,7 +495,6 @@ NTSTATUS wg_transform_set_output_format(void *args) const struct wg_format *format = params->format; GstSample *sample; GstCaps *caps; - gchar *str;
if (!(caps = wg_format_to_caps(format))) { @@ -537,9 +533,7 @@ NTSTATUS wg_transform_set_output_format(void *args) return STATUS_UNSUCCESSFUL; }
- str = gst_caps_to_string(caps); - GST_INFO("Configured new caps %s.", str); - g_free(str); + GST_INFO("Configured new caps %" GST_PTR_FORMAT ".", caps);
/* Ideally and to be fully compatible with native transform, the queued * output buffers will need to be converted to the new output format and