mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
ext/mad/gstmad.c: It'd be nice if I could listen to my mp3 files, so send out an initial discont, as the sink apparen...
Original commit message from CVS: * ext/mad/gstmad.c: (gst_mad_init), (gst_mad_chain): It'd be nice if I could listen to my mp3 files, so send out an initial discont, as the sink apparently wants.
This commit is contained in:
parent
7ba5f9a9cd
commit
c5a6eb857e
2 changed files with 17 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-08-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* ext/mad/gstmad.c: (gst_mad_init), (gst_mad_chain):
|
||||
It'd be nice if I could listen to my mp3 files, so send out an
|
||||
initial discont, as the sink apparently wants.
|
||||
|
||||
2005-08-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* gst/avi/gstavidemux.c: (gst_avi_demux_handle_src_event),
|
||||
|
|
|
@ -360,7 +360,7 @@ gst_mad_init (GstMad * mad)
|
|||
mad->framecount = 0;
|
||||
mad->vbr_average = 0;
|
||||
mad->vbr_rate = 0;
|
||||
mad->restart = FALSE;
|
||||
mad->restart = TRUE;
|
||||
mad->segment_start = 0;
|
||||
mad->header.mode = -1;
|
||||
mad->header.emphasis = -1;
|
||||
|
@ -1215,12 +1215,15 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer)
|
|||
gboolean new_pts = FALSE;
|
||||
GstClockTime timestamp;
|
||||
GstFlowReturn result = GST_FLOW_OK;
|
||||
gboolean do_send_discont = FALSE;
|
||||
|
||||
mad = GST_MAD (GST_PAD_PARENT (pad));
|
||||
|
||||
/* restarts happen on discontinuities, ie. seek, flush, PAUSED to PLAYING */
|
||||
if (gst_mad_check_restart (mad))
|
||||
if (gst_mad_check_restart (mad)) {
|
||||
do_send_discont = TRUE;
|
||||
GST_DEBUG ("mad restarted");
|
||||
}
|
||||
|
||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
||||
GST_DEBUG ("mad in timestamp %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp));
|
||||
|
@ -1493,6 +1496,12 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer)
|
|||
}
|
||||
}
|
||||
|
||||
if (do_send_discont) {
|
||||
gst_pad_push_event (mad->srcpad,
|
||||
gst_event_new_newsegment (1.0, GST_FORMAT_TIME,
|
||||
GST_BUFFER_TIMESTAMP (outbuffer), GST_CLOCK_TIME_NONE, 0));
|
||||
do_send_discont = FALSE;
|
||||
}
|
||||
result = gst_pad_push (mad->srcpad, outbuffer);
|
||||
if (result != GST_FLOW_OK) {
|
||||
goto end;
|
||||
|
|
Loading…
Reference in a new issue