From: Benjamin O. <co...@us...> - 2003-04-29 21:55:02
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: company Date: Tue Apr 29 2003 14:55:00 PDT Log message: bugfixes: - seek correctly on SEEK_METHOD_END - don't emit a warning when mp3's in wav's have no width information - use BYTES format on discontinuous events and omit timestamp when invalid (mp3 anyone?) Modified files: gst/wavparse : gstwavparse.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/wavparse/gstwavparse.c.diff?r1=1.24&r2=1.25 ====Begin Diffs==== Index: gstwavparse.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/wavparse/gstwavparse.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- gstwavparse.c 11 Apr 2003 21:52:18 -0000 1.24 +++ gstwavparse.c 29 Apr 2003 21:54:47 -0000 1.25 @@ -267,10 +267,18 @@ &GST_BUFFER_TIMESTAMP (buf)); if (wavparse->need_discont) { - gst_pad_push (wavparse->srcpad, - GST_BUFFER (gst_event_new_discontinuous (FALSE, + if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) { + gst_pad_push (wavparse->srcpad, + GST_BUFFER (gst_event_new_discontinuous (FALSE, + GST_FORMAT_BYTES, wavparse->offset, GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (buf), NULL))); + } else { + gst_pad_push (wavparse->srcpad, + GST_BUFFER (gst_event_new_discontinuous (FALSE, + GST_FORMAT_BYTES, wavparse->offset, + NULL))); + } wavparse->need_discont = FALSE; } gst_pad_push (wavparse->srcpad, buf); @@ -499,9 +507,8 @@ bytes_per_sample = wavparse->channels * wavparse->width / 8; if (bytes_per_sample == 0) { - g_warning ("bytes_per_sample is 0, internal error\n"); - g_warning ("channels %d, width %d\n", - wavparse->channels, wavparse->width); + GST_DEBUG (0, "bytes_per_sample is 0, probably an mp3 - channels %d, width %d\n", + wavparse->channels, wavparse->width); return FALSE; } byterate = (glong) (bytes_per_sample * wavparse->rate); @@ -630,7 +637,7 @@ seek = gst_event_new_seek ( GST_FORMAT_BYTES | (GST_EVENT_SEEK_TYPE (event) & ~GST_SEEK_FORMAT_MASK), - byteoffset + wavparse->datastart); + byteoffset + (GST_EVENT_SEEK_METHOD (event) == GST_SEEK_METHOD_END ? 0 : wavparse->datastart)); res = gst_pad_send_event (GST_PAD_PEER (wavparse->sinkpad), seek); |