Commit f2fb7149 authored by Benjamin Otte's avatar Benjamin Otte
Browse files

-fix segfault on PAUSED => READY when metadata wasn't set

Original commit message from CVS:
-fix segfault on PAUSED => READY when metadata wasn't set
- fix caps mimetype that always caused a failure on caps nego
parent 29e9ebcf
...@@ -174,10 +174,10 @@ flac_caps_factory (void) ...@@ -174,10 +174,10 @@ flac_caps_factory (void)
gst_caps_new ( gst_caps_new (
"flac_flac", "flac_flac",
"application/x-flac", "application/x-flac",
/*gst_props_new ( /* gst_props_new (
"rate", GST_PROPS_INT_RANGE (11025, 48000), "rate", GST_PROPS_INT_RANGE (11025, 48000),
"channels", GST_PROPS_INT_RANGE (1, 2), "channels", GST_PROPS_INT_RANGE (1, 2),
NULL)*/ NULL); NULL) */NULL);
} }
static GstCaps* static GstCaps*
...@@ -386,7 +386,7 @@ gst_flacenc_sinkconnect (GstPad *pad, GstCaps *caps) ...@@ -386,7 +386,7 @@ gst_flacenc_sinkconnect (GstPad *pad, GstCaps *caps)
gst_caps_get_int (caps, "rate", &flacenc->sample_rate); gst_caps_get_int (caps, "rate", &flacenc->sample_rate);
caps = GST_CAPS_NEW ("flacenc_srccaps", caps = GST_CAPS_NEW ("flacenc_srccaps",
"audio/x-flac", "application/x-flac",
"channels", GST_PROPS_INT (flacenc->channels), "channels", GST_PROPS_INT (flacenc->channels),
"rate", GST_PROPS_INT (flacenc->sample_rate)); "rate", GST_PROPS_INT (flacenc->sample_rate));
ret = gst_pad_try_set_caps (flacenc->srcpad, caps); ret = gst_pad_try_set_caps (flacenc->srcpad, caps);
...@@ -776,8 +776,11 @@ gst_flacenc_change_state (GstElement *element) ...@@ -776,8 +776,11 @@ gst_flacenc_change_state (GstElement *element)
flacenc->first_buf = NULL; flacenc->first_buf = NULL;
g_free (flacenc->data); g_free (flacenc->data);
flacenc->data = NULL; flacenc->data = NULL;
FLAC__metadata_object_delete (flacenc->meta[0]); if (flacenc->meta) {
g_free (flacenc->meta); FLAC__metadata_object_delete (flacenc->meta[0]);
g_free (flacenc->meta);
flacenc->meta = NULL;
}
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_READY_TO_NULL:
default: default:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment