gst/wavenc/gstwavenc.*: Added newmedia support to wavenc

Original commit message from CVS:
2004-09-19  Zaheer Abbas Merali  <zaheerabbas at merali dot org>

* gst/wavenc/gstwavenc.c: (gst_wavenc_init), (gst_wavenc_chain):
* gst/wavenc/gstwavenc.h:
Added newmedia support to wavenc
This commit is contained in:
Zaheer Abbas Merali 2004-09-19 17:55:04 +00:00
parent dd6ce2d6ba
commit e3beb3a1d5
3 changed files with 20 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2004-09-19 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* gst/wavenc/gstwavenc.c: (gst_wavenc_init), (gst_wavenc_chain):
* gst/wavenc/gstwavenc.h:
Added newmedia support to wavenc
2004-09-17 Wim Taymans <wim@fluendo.com>
* gst/tcp/gstfdset.c: (gst_fdset_fd_has_closed),

View file

@ -294,7 +294,7 @@ gst_wavenc_init (GstWavEnc * wavenc)
wavenc->setup = FALSE;
wavenc->flush_header = TRUE;
wavenc->newmediacount = 0;
GST_FLAG_SET (wavenc, GST_ELEMENT_EVENT_AWARE);
}
@ -619,6 +619,17 @@ gst_wavenc_chain (GstPad * pad, GstData * _data)
gst_wavenc_stop_file (wavenc);
gst_pad_push (wavenc->srcpad, _data);
gst_element_set_eos (GST_ELEMENT (wavenc));
} else if (GST_EVENT_TYPE (buf) == GST_EVENT_DISCONTINUOUS) {
if (GST_EVENT_DISCONT_NEW_MEDIA (buf)) {
/* new media */
if (wavenc->newmediacount++ > 0) {
gst_wavenc_stop_file (wavenc);
wavenc->setup = FALSE;
wavenc->flush_header = TRUE;
gst_wavenc_setup (wavenc);
}
gst_pad_event_default (wavenc->srcpad, GST_EVENT (buf));
}
} else {
gst_pad_event_default (wavenc->srcpad, GST_EVENT (buf));
}

View file

@ -57,6 +57,8 @@ struct _GstWavEnc {
gboolean setup, flush_header, pad_eos;
guchar header[WAV_HEADER_LEN];
guint16 newmediacount;
};
struct _GstWavEncClass {