diff --git a/ChangeLog b/ChangeLog index 94b685e00e..edf7b9b1b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2004-01-31 Benjamin Otte + + * ext/alsa/gstalsa.c: (gst_alsa_change_state), (gst_alsa_start), + (gst_alsa_drain_audio), (gst_alsa_stop_audio): + really start/stop clock only on PLAYING <=> PAUSED + * ext/alsa/gstalsasink.c: (gst_alsa_sink_loop): + remove \n from debugging lines + * ext/ogg/gstoggdemux.c: (gst_ogg_demux_chain): + make it work when seeking does not + * ext/vorbis/vorbisdec.c: (vorbis_dec_event): + reset on DISCONT + 2004-01-31 Benjamin Otte * ext/alsa/gstalsa.c: (gst_alsa_change_state), (gst_alsa_start): diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index 85b297ec59..a030ac67d6 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -720,6 +720,9 @@ gst_alsa_change_state (GstElement *element) GST_ERROR_OBJECT (this, "Error unpausing sound: %s", snd_strerror (err)); return GST_STATE_FAILURE; } + } else if (! (GST_FLAG_IS_SET (element, GST_ALSA_RUNNING) || + gst_alsa_start_audio (this))) { + return GST_STATE_FAILURE; } gst_alsa_clock_start (this->clock); break; @@ -730,11 +733,13 @@ gst_alsa_change_state (GstElement *element) GST_ERROR_OBJECT (this, "Error pausing sound: %s", snd_strerror (err)); return GST_STATE_FAILURE; } - gst_alsa_clock_stop (this->clock); } break; } + gst_alsa_clock_stop (this->clock); /* if device doesn't know how to pause, we just stop */ + if (GST_FLAG_IS_SET (element, GST_ALSA_RUNNING)) gst_alsa_stop_audio (this); + break; case GST_STATE_PAUSED_TO_READY: if (GST_FLAG_IS_SET (element, GST_ALSA_RUNNING)) gst_alsa_stop_audio (this); g_free (this->format); @@ -836,7 +841,6 @@ gst_alsa_start (GstAlsa *this) g_assert_not_reached (); break; } - /* gst_alsa_clock_start (this->clock); */ return TRUE; } void @@ -1071,7 +1075,6 @@ gst_alsa_drain_audio (GstAlsa *this) switch (snd_pcm_state (this->handle)) { case SND_PCM_STATE_XRUN: case SND_PCM_STATE_RUNNING: - gst_alsa_clock_stop (this->clock); /* fall through - clock is already stopped when paused */ case SND_PCM_STATE_PAUSED: /* snd_pcm_drain only works in blocking mode */ @@ -1098,7 +1101,6 @@ gst_alsa_stop_audio (GstAlsa *this) switch (snd_pcm_state (this->handle)) { case SND_PCM_STATE_XRUN: case SND_PCM_STATE_RUNNING: - gst_alsa_clock_stop (this->clock); /* fall through - clock is already stopped when paused */ case SND_PCM_STATE_PAUSED: ERROR_CHECK (snd_pcm_drop (this->handle), diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index e82698d8da..2e9ee223eb 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -374,7 +374,7 @@ no_difference: int samples = MIN (bytes, sample_diff) * (element->numpads == 1 ? this->format->channels : 1); int size = samples * snd_pcm_format_physical_width (this->format->format) / 8; - GST_INFO_OBJECT (this, "Allocating %d bytes (%ld samples) now to resync: sample %ld expected, but got %ld\n", + GST_INFO_OBJECT (this, "Allocating %d bytes (%ld samples) now to resync: sample %ld expected, but got %ld", size, MIN (bytes, sample_diff), time_sample, samplestamp); sink->data[i] = g_try_malloc (size); if (!sink->data[i]) { @@ -387,7 +387,7 @@ no_difference: } sink->behaviour[i] = 1; } else if (gst_alsa_samples_to_bytes (this, -sample_diff) >= sink->buf[i]->size) { - GST_INFO_OBJECT (this, "Skipping %lu samples to resync (complete buffer): sample %ld expected, but got %ld\n", + GST_INFO_OBJECT (this, "Skipping %lu samples to resync (complete buffer): sample %ld expected, but got %ld", gst_alsa_bytes_to_samples (this, sink->buf[i]->size), time_sample, samplestamp); /* this buffer is way behind */ gst_buffer_unref (sink->buf[i]); @@ -395,7 +395,7 @@ no_difference: continue; } else if (sample_diff < 0) { gint difference = gst_alsa_samples_to_bytes (this, -samplestamp); - GST_INFO_OBJECT (this, "Skipping %lu samples to resync: sample %ld expected, but got %ld\n", + GST_INFO_OBJECT (this, "Skipping %lu samples to resync: sample %ld expected, but got %ld", (gulong) -sample_diff, time_sample, samplestamp); /* this buffer is only a bit behind */ sink->size[i] = sink->buf[i]->size - difference; diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index c6c9a04c66..9858f73c5d 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -564,6 +564,7 @@ gst_ogg_demux_chain (GstPad *pad, GstData *buffer) GST_FLAG_SET (ogg, GST_OGG_FLAG_WAIT_FOR_DISCONT); goto out; } + gst_ogg_add_chain (ogg); GST_OGG_SET_STATE (ogg, GST_OGG_STATE_PLAY); /* fall through */ case GST_OGG_STATE_SEEK: diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index 82cb749178..b8ab48409d 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -276,6 +276,7 @@ vorbis_dec_event (GstVorbisDec *dec, GstEvent *event) } else { GST_ERROR_OBJECT (dec, "failed to parse data for DISCONT event, not sending any"); } + vorbis_synthesis_restart (&dec->vd); } break; default: