mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
ext/vorbis/vorbisenc.c: Don't flush encoder state unless we have an initialised encoder.
Original commit message from CVS: * ext/vorbis/vorbisenc.c: (gst_vorbisenc_clear), (gst_vorbisenc_sink_event), (gst_vorbisenc_change_state): Don't flush encoder state unless we have an initialised encoder. Clear out encoder state on PAUSED_TO_READY.
This commit is contained in:
parent
9798126a0b
commit
17d40cbbd1
2 changed files with 27 additions and 9 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-09-22 Michael Smith <msmith@fluendo.com>
|
||||
|
||||
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_clear),
|
||||
(gst_vorbisenc_sink_event), (gst_vorbisenc_change_state):
|
||||
Don't flush encoder state unless we have an initialised encoder.
|
||||
Clear out encoder state on PAUSED_TO_READY.
|
||||
|
||||
2005-09-22 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst-libs/gst/rtp/gstbasertppayload.c:
|
||||
|
|
|
@ -777,6 +777,24 @@ gst_vorbisenc_setup (GstVorbisEnc * vorbisenc)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_vorbisenc_clear (GstVorbisEnc * vorbisenc)
|
||||
{
|
||||
if (vorbisenc->setup) {
|
||||
vorbis_analysis_wrote (&vorbisenc->vd, 0);
|
||||
gst_vorbisenc_output_buffers (vorbisenc);
|
||||
|
||||
vorbisenc->setup = FALSE;
|
||||
}
|
||||
|
||||
/* clean up and exit. vorbis_info_clear() must be called last */
|
||||
vorbis_block_clear (&vorbisenc->vb);
|
||||
vorbis_dsp_clear (&vorbisenc->vd);
|
||||
vorbis_info_clear (&vorbisenc->vi);
|
||||
|
||||
vorbisenc->header_sent = FALSE;
|
||||
}
|
||||
|
||||
/* prepare a buffer for transmission by passing data through libvorbis */
|
||||
static GstBuffer *
|
||||
gst_vorbisenc_buffer_from_packet (GstVorbisEnc * vorbisenc, ogg_packet * packet)
|
||||
|
@ -866,13 +884,7 @@ gst_vorbisenc_sink_event (GstPad * pad, GstEvent * event)
|
|||
/* Tell the library we're at end of stream so that it can handle
|
||||
* the last frame and mark end of stream in the output properly */
|
||||
GST_DEBUG_OBJECT (vorbisenc, "EOS, clearing state and sending event on");
|
||||
vorbis_analysis_wrote (&vorbisenc->vd, 0);
|
||||
gst_vorbisenc_output_buffers (vorbisenc);
|
||||
|
||||
/* clean up and exit. vorbis_info_clear() must be called last */
|
||||
vorbis_block_clear (&vorbisenc->vb);
|
||||
vorbis_dsp_clear (&vorbisenc->vd);
|
||||
vorbis_info_clear (&vorbisenc->vi);
|
||||
gst_vorbisenc_clear (vorbisenc);
|
||||
|
||||
res = gst_pad_event_default (pad, event);
|
||||
break;
|
||||
|
@ -1140,8 +1152,7 @@ gst_vorbisenc_change_state (GstElement * element, GstStateChange transition)
|
|||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
vorbisenc->setup = FALSE;
|
||||
vorbisenc->header_sent = FALSE;
|
||||
gst_vorbisenc_clear (vorbisenc);
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
gst_tag_list_free (vorbisenc->tags);
|
||||
|
|
Loading…
Reference in a new issue