audioencoder: save audio info parsed in setcaps in encoder context
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 30 Oct 2011 14:51:48 +0000 (14:51 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 31 Oct 2011 14:22:39 +0000 (14:22 +0000)
Otherwise we'll just error out when the first buffer gets pushed.
This is a porting artefact, in 0.10 the infos were allocated on the
heap, now we're doing everything with stack-allocated structs.

gst-libs/gst/audio/gstaudioencoder.c

index 4952236..c5f1a86 100644 (file)
@@ -1081,6 +1081,9 @@ gst_audio_encoder_sink_setcaps (GstAudioEncoder * enc, GstCaps * caps)
     if (klass->set_format)
       res = klass->set_format (enc, &state);
 
+    if (res)
+      ctx->info = state;
+
     /* notify if new latency */
     GST_OBJECT_LOCK (enc);
     if ((ctx->min_latency > 0 && ctx->min_latency != old_min_latency) ||