diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 3bf1682189..ea501716f4 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -1299,6 +1299,7 @@ gst_ogg_pad_handle_push_mode_state (GstOggPad * pad, ogg_page * page) GstFlowReturn res; /* tell the pipeline we've just found out the duration */ + ogg->push_time_length = ogg->total_time; GST_INFO_OBJECT (ogg, "New duration found: %" GST_TIME_FORMAT, GST_TIME_ARGS (ogg->total_time)); message = diff --git a/ext/theora/gsttheoraenc.c b/ext/theora/gsttheoraenc.c index 40cba12580..e31ff42934 100644 --- a/ext/theora/gsttheoraenc.c +++ b/ext/theora/gsttheoraenc.c @@ -282,7 +282,7 @@ gst_theora_enc_class_init (GstTheoraEncClass * klass) th_ctx = dummy_encode_ctx (); if (th_ctx) { - if (!check_speed_level (th_ctx, &default_speed_level, &max_speed_level)) + if (check_speed_level (th_ctx, &default_speed_level, &max_speed_level)) GST_WARNING ("Failed to determine settings for the speed-level property."); th_encode_free (th_ctx); @@ -555,10 +555,10 @@ theora_enc_get_supported_formats (void) { th_enc_ctx *encoder; th_info info; - struct + static const struct { th_pixel_fmt pixelformat; - const char *fourcc; + const char fourcc[]; } formats[] = { { TH_PF_420, "I420"}, { @@ -769,9 +769,8 @@ theora_buffer_from_packet (GstTheoraEnc * enc, ogg_packet * packet, enc->next_discont = FALSE; } - /* the second most significant bit of the first data byte is cleared - * for keyframes */ - if (packet->bytes > 0 && (packet->packet[0] & 0x40) == 0) { + /* th_packet_iskeyframe returns positive for keyframes */ + if (th_packet_iskeyframe (packet) > 0) { GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DELTA_UNIT); } else { GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT); @@ -1218,7 +1217,7 @@ theora_enc_chain (GstPad * pad, GstBuffer * buffer) enc = GST_THEORA_ENC (GST_PAD_PARENT (pad)); /* we keep track of two timelines. - * - The timestamps from the incomming buffers, which we copy to the outgoing + * - The timestamps from the incoming buffers, which we copy to the outgoing * encoded buffers as-is. We need to do this as we simply forward the * newsegment events. * - The running_time of the buffers, which we use to construct the granulepos @@ -1277,7 +1276,7 @@ theora_enc_chain (GstPad * pad, GstBuffer * buffer) } /* make sure we copy the discont flag to the next outgoing buffer when it's - * set on the incomming buffer */ + * set on the incoming buffer */ if (GST_BUFFER_IS_DISCONT (buffer)) { enc->next_discont = TRUE; } @@ -1382,11 +1381,19 @@ theora_enc_change_state (GstElement * element, GstStateChange transition) { GstTheoraEnc *enc; GstStateChangeReturn ret; + th_enc_ctx *th_ctx; enc = GST_THEORA_ENC (element); switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: + th_ctx = dummy_encode_ctx (); + if (!th_ctx) { + GST_ELEMENT_ERROR (enc, STREAM, ENCODE, (NULL), + ("libtheora has been compiled with the encoder disabled")); + return GST_STATE_CHANGE_FAILURE; + } + th_encode_free (th_ctx); break; case GST_STATE_CHANGE_READY_TO_PAUSED: GST_DEBUG_OBJECT (enc, "READY->PAUSED Initing theora state"); @@ -1469,6 +1476,8 @@ theora_enc_set_property (GObject * object, guint prop_id, case PROP_NOISE_SENSITIVITY: case PROP_SHARPNESS: /* kept for API compat, but ignored */ + GST_WARNING_OBJECT (object, "Obsolete property '%s' ignored", + pspec->name); break; case PROP_BITRATE: GST_OBJECT_LOCK (enc); diff --git a/tests/check/gst-plugins-base.supp b/tests/check/gst-plugins-base.supp index 0d0705d417..718b63d9ff 100644 --- a/tests/check/gst-plugins-base.supp +++ b/tests/check/gst-plugins-base.supp @@ -387,3 +387,123 @@ obj:/usr/lib/libfontconfig.so.* fun:FcFontRenderPrepare } +# ALSA leaks which are fixed by calling snd_config_update_free_global +{ + + Memcheck:Leak + fun:malloc + fun:strdup + obj:/usr/lib/libasound.so.2.0.0 + obj:/usr/lib/libasound.so.2.0.0 + fun:gst_alsa_get_device_list + fun:gst_alsa_device_property_probe_get_values + fun:gst_property_probe_get_values + fun:gst_property_probe_probe_and_get_values + fun:gst_property_probe_probe_and_get_values_name + fun:test_device_property_probe + fun:srunner_run_all + fun:gst_check_run_suite + fun:main +} +{ + + Memcheck:Leak + fun:malloc + obj:/usr/lib/libasound.so.2.0.0 + obj:/usr/lib/libasound.so.2.0.0 + fun:gst_alsa_get_device_list + fun:gst_alsa_device_property_probe_get_values + fun:gst_property_probe_get_values + fun:gst_property_probe_probe_and_get_values + fun:gst_property_probe_probe_and_get_values_name + fun:test_device_property_probe + fun:srunner_run_all + fun:gst_check_run_suite + fun:main +} +{ + + Memcheck:Leak + fun:malloc + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:_dlerror_run + fun:dlclose + obj:/usr/lib/libasound.so.2.0.0 + fun:snd_config_searcha_hooks + fun:snd_config_searchva_hooks + obj:/usr/lib/libasound.so.2.0.0 + fun:snd_config_search_definition + obj:/usr/lib/libasound.so.2.0.0 + fun:gst_alsa_get_device_list + fun:gst_alsa_device_property_probe_get_values + fun:gst_property_probe_get_values + fun:gst_property_probe_probe_and_get_values + fun:gst_property_probe_probe_and_get_values_name + fun:test_device_property_probe + fun:srunner_run_all + fun:gst_check_run_suite +} +{ + + Memcheck:Leak + fun:malloc + fun:strdup + obj:/usr/lib/libasound.so.2.0.0 + obj:/usr/lib/libasound.so.2.0.0 + fun:snd_hctl_open + fun:snd_mixer_attach + fun:gst_alsa_mixer_open + fun:gst_alsa_mixer_new + fun:gst_alsa_mixer_element_change_state + fun:gst_element_change_state + fun:gst_element_set_state_func + fun:test_alsa_mixer_track + fun:srunner_run_all + fun:gst_check_run_suite + fun:main +} +{ + + Memcheck:Leak + fun:malloc + fun:strdup + obj:/usr/lib/libasound.so.2.0.0 + obj:/usr/lib/libasound.so.2.0.0 + fun:snd_hctl_open + fun:snd_mixer_attach + fun:gst_alsa_mixer_open + fun:gst_alsa_mixer_new + fun:gst_alsa_mixer_element_change_state + fun:gst_element_change_state + fun:gst_element_set_state_func + fun:test_alsa_mixer_track + fun:srunner_run_all + fun:gst_check_run_suite + fun:main +} +{ + + Memcheck:Leak + fun:malloc + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:_dlerror_run + fun:dlclose + obj:/usr/lib/libasound.so.2.0.0 + fun:snd_config_searcha_hooks + fun:snd_config_searchva_hooks + obj:/usr/lib/libasound.so.2.0.0 + fun:snd_config_search_definition + obj:/usr/lib/libasound.so.2.0.0 + fun:snd_hctl_open + fun:snd_mixer_attach + fun:gst_alsa_mixer_open + fun:gst_alsa_mixer_new + fun:gst_alsa_mixer_element_change_state + fun:gst_element_change_state + fun:gst_element_set_state_func + fun:test_alsa_mixer_track +}