From: Ronald B. <rb...@us...> - 2003-05-13 12:28:30
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: rbultje Date: Tue May 13 2003 05:28:28 PDT Log message: Get timestamping somewhat better Modified files: ext/lame : gstlame.c gstlame.h Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/lame/gstlame.c.diff?r1=1.28&r2=1.29 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/lame/gstlame.h.diff?r1=1.5&r2=1.6 ====Begin Diffs==== Index: gstlame.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/ext/lame/gstlame.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- gstlame.c 12 May 2003 20:08:17 -0000 1.28 +++ gstlame.c 13 May 2003 12:28:16 -0000 1.29 @@ -630,7 +630,6 @@ GstBuffer *outbuf; gchar *mp3_data = NULL; gint mp3_buffer_size, mp3_size = 0; - guint mp3_ts = 0; gboolean eos = FALSE; lame = GST_LAME (gst_pad_get_parent (pad)); @@ -682,7 +681,7 @@ "encoded %d bytes of audio to %d bytes of mp3", GST_BUFFER_SIZE (buf), mp3_size); - mp3_ts = GST_BUFFER_TIMESTAMP (buf); + lame->last_ts = GST_BUFFER_TIMESTAMP (buf); gst_buffer_unref (buf); } @@ -691,7 +690,7 @@ outbuf = gst_buffer_new (); GST_BUFFER_DATA (outbuf) = mp3_data; GST_BUFFER_SIZE (outbuf) = mp3_size; - GST_BUFFER_TIMESTAMP (outbuf) = mp3_ts; + GST_BUFFER_TIMESTAMP (outbuf) = lame->last_ts; gst_pad_push (lame->srcpad,outbuf); } @@ -784,6 +783,9 @@ GST_DEBUG (0,"state pending %d", GST_STATE_PENDING (element)); switch (GST_STATE_TRANSITION (element)) { + case GST_STATE_READY_TO_PAUSED: + lame->last_ts = 0; + break; case GST_STATE_READY_TO_NULL: if (lame->initialized) { lame_close (lame->lgf); Index: gstlame.h =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/ext/lame/gstlame.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- gstlame.h 20 Mar 2002 21:44:42 -0000 1.5 +++ gstlame.h 13 May 2003 12:28:16 -0000 1.6 @@ -93,6 +93,9 @@ gboolean emphasis; lame_global_flags *lgf; + + /* time tracker */ + guint64 last_ts; }; struct _GstLameClass { |