summaryrefslogtreecommitdiffstats
path: root/sys/oss
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-06-05 18:50:48 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-06-05 18:50:48 +0000
commit45b9c254157e3cf558680a804f80ea2f293c7245 (patch)
treeec7a44e594da0a3627fb861bf8ba2e063f23eda4 /sys/oss
parentd30bd0177003dbd1bb797ee034e82eb82fc7fab0 (diff)
gst/qtdemux/qtdemux.*: Bitch. Also known as seeking, querying & co.
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_init), (gst_qtdemux_handle_src_query), (gst_qtdemux_handle_src_event), (gst_qtdemux_handle_sink_event), (gst_qtdemux_change_state), (gst_qtdemux_loop_header), (qtdemux_dump_mvhd), (qtdemux_parse_trak): * gst/qtdemux/qtdemux.h: Bitch. Also known as seeking, querying & co. * sys/oss/gstosssink.c: (gst_osssink_init), (gst_osssink_chain), (gst_osssink_change_state): * sys/oss/gstosssink.h: Resyncing is for weenies, this hack is no longer needed and was broken anyway (since it - unintendedly - always leaves resync to TRUE).
Diffstat (limited to 'sys/oss')
-rw-r--r--sys/oss/gstosssink.c44
-rw-r--r--sys/oss/gstosssink.h1
2 files changed, 16 insertions, 29 deletions
diff --git a/sys/oss/gstosssink.c b/sys/oss/gstosssink.c
index 08de079b..befb57fd 100644
--- a/sys/oss/gstosssink.c
+++ b/sys/oss/gstosssink.c
@@ -218,7 +218,6 @@ gst_osssink_init (GstOssSink * osssink)
osssink->chunk_size = 4096;
osssink->mute = FALSE;
osssink->sync = TRUE;
- osssink->resync = TRUE;
osssink->provided_clock =
gst_audio_clock_new ("ossclock", gst_osssink_get_time, osssink);
gst_object_set_parent (GST_OBJECT (osssink->provided_clock),
@@ -392,9 +391,6 @@ gst_osssink_chain (GstPad * pad, GstData * _data)
FALSE);
gst_pad_event_default (pad, event);
return;
- case GST_EVENT_DISCONTINUOUS:
- osssink->resync = TRUE;
- /* pass-through */
default:
gst_pad_event_default (pad, event);
return;
@@ -424,13 +420,13 @@ gst_osssink_chain (GstPad * pad, GstData * _data)
buftime = soundtime;
}
GST_LOG_OBJECT (osssink,
- "time: real %" G_GUINT64_FORMAT ", buffer: %" G_GUINT64_FORMAT, soundtime,
- buftime);
+ "time: real %" GST_TIME_FORMAT ", buffer: %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (soundtime), GST_TIME_ARGS (buftime));
if (MAX (buftime, soundtime) - MIN (buftime, soundtime) > (GST_SECOND / 10)) {
/* we need to adjust to the buffers here */
GST_INFO_OBJECT (osssink,
- "need sync: real %" G_GUINT64_FORMAT ", buffer: %" G_GUINT64_FORMAT,
- soundtime, buftime);
+ "need sync: real %" GST_TIME_FORMAT ", buffer: %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (soundtime), GST_TIME_ARGS (buftime));
if (soundtime > buftime) {
/* do *not* throw frames out. It's useless. The next frame will come in
* too late. And the next one. And so on. We don't want to lose sound.
@@ -444,29 +440,22 @@ gst_osssink_chain (GstPad * pad, GstData * _data)
GST_OSSELEMENT (osssink)->channels)) *
(GST_OSSELEMENT (osssink)->width / 8) *
GST_OSSELEMENT (osssink)->channels;
+ guint8 *sbuf = g_new (guint8, to_handle);
- if (!osssink->resync) {
- guint8 *buf = g_new (guint8, to_handle);
+ memset (sbuf, (GST_OSSELEMENT (osssink)->width == 8) ? 0 : 128,
+ to_handle);
+ while (to_handle > 0) {
+ gint done = write (GST_OSSELEMENT (osssink)->fd, sbuf,
+ MIN (to_handle, osssink->chunk_size));
- memset (buf, (GST_OSSELEMENT (osssink)->width == 8) ? 0 : 128,
- to_handle);
- while (to_handle > 0) {
- gint done = write (GST_OSSELEMENT (osssink)->fd, buf,
- MIN (to_handle, osssink->chunk_size));
-
- if (done == -1 && errno != EINTR) {
- break;
- } else {
- to_handle -= done;
- osssink->handled += done;
- }
+ if (done == -1 && errno != EINTR) {
+ break;
+ } else {
+ to_handle -= done;
+ osssink->handled += done;
}
- g_free (buf);
- } else {
- /* Timestamps at start-of-stream (MPEG) or after seek (hey,
- * again MPEG!) can be borken, therefore this hacklet. */
- osssink->handled += to_handle;
}
+ g_free (sbuf);
}
}
@@ -666,7 +655,6 @@ gst_osssink_change_state (GstElement * element)
ioctl (GST_OSSELEMENT (osssink)->fd, SNDCTL_DSP_RESET, 0);
gst_osselement_reset (GST_OSSELEMENT (osssink));
osssink->handled = 0;
- osssink->resync = TRUE;
break;
default:
break;
diff --git a/sys/oss/gstosssink.h b/sys/oss/gstosssink.h
index f484007b..7542c8d1 100644
--- a/sys/oss/gstosssink.h
+++ b/sys/oss/gstosssink.h
@@ -59,7 +59,6 @@ struct _GstOssSink {
GstClock *provided_clock;
GstClock *clock;
- gboolean resync;
gboolean sync;
guint64 handled;