summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst
diff options
context:
space:
mode:
authorJulien Moutte <julien@moutte.net>2004-01-29 22:44:42 +0000
committerJulien Moutte <julien@moutte.net>2004-01-29 22:44:42 +0000
commit7c858cbf0f10a48386f7098420fde939eda25eb5 (patch)
tree2c176b2508c423fbe9c3d520202ac36c4330ec73 /gst-libs/gst
parent8b821fcb23903a3d61aa303af7e0abab2de8ca4a (diff)
downloadgst-plugins-bad-7c858cbf0f10a48386f7098420fde939eda25eb5.tar.gz
gst-plugins-bad-7c858cbf0f10a48386f7098420fde939eda25eb5.tar.bz2
gst-plugins-bad-7c858cbf0f10a48386f7098420fde939eda25eb5.zip
ext/gnomevfs/gstgnomevfssrc.c: Fixing seeking emiting FLUSH and even before DISCONT.
Original commit message from CVS: 2004-01-29 Julien MOUTTE <julien@moutte.net> * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get): Fixing seeking emiting FLUSH and even before DISCONT. * gst-libs/gst/play/gstplay.c: (gst_play_seek_to_time): Fix seeking to get the best instant seeking as possible yay!
Diffstat (limited to 'gst-libs/gst')
-rw-r--r--gst-libs/gst/play/gstplay.c17
-rw-r--r--gst-libs/gst/play/play.c17
2 files changed, 20 insertions, 14 deletions
diff --git a/gst-libs/gst/play/gstplay.c b/gst-libs/gst/play/gstplay.c
index f9389ea1..35f6d5cc 100644
--- a/gst-libs/gst/play/gstplay.c
+++ b/gst-libs/gst/play/gstplay.c
@@ -624,7 +624,7 @@ gst_play_get_location (GstPlay *play)
gboolean
gst_play_seek_to_time (GstPlay * play, gint64 time_nanos)
{
- GstElement *audio_sink_element, *video_sink_element;
+ GstElement *audio_seek_element, *video_seek_element, *audio_sink_element;
g_return_val_if_fail (play != NULL, FALSE);
g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
@@ -632,20 +632,23 @@ gst_play_seek_to_time (GstPlay * play, gint64 time_nanos)
if (time_nanos < 0LL)
time_nanos = 0LL;
+ audio_seek_element = g_hash_table_lookup (play->priv->elements,
+ "audioconvert");
audio_sink_element = g_hash_table_lookup (play->priv->elements,
"audio_sink_element");
- video_sink_element = g_hash_table_lookup (play->priv->elements,
- "video_sink_element");
+ video_seek_element = g_hash_table_lookup (play->priv->elements,
+ "identity");
- if (GST_IS_ELEMENT (audio_sink_element) &&
- GST_IS_ELEMENT (video_sink_element)) {
+ if (GST_IS_ELEMENT (audio_seek_element) &&
+ GST_IS_ELEMENT (video_seek_element) &&
+ GST_IS_ELEMENT (audio_sink_element)) {
gboolean s = FALSE;
- s = gst_element_seek (video_sink_element, GST_FORMAT_TIME |
+ s = gst_element_seek (video_seek_element, GST_FORMAT_TIME |
GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH,
time_nanos);
if (!s) {
- s = gst_element_seek (audio_sink_element, GST_FORMAT_TIME |
+ s = gst_element_seek (audio_seek_element, GST_FORMAT_TIME |
GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH,
time_nanos);
}
diff --git a/gst-libs/gst/play/play.c b/gst-libs/gst/play/play.c
index f9389ea1..35f6d5cc 100644
--- a/gst-libs/gst/play/play.c
+++ b/gst-libs/gst/play/play.c
@@ -624,7 +624,7 @@ gst_play_get_location (GstPlay *play)
gboolean
gst_play_seek_to_time (GstPlay * play, gint64 time_nanos)
{
- GstElement *audio_sink_element, *video_sink_element;
+ GstElement *audio_seek_element, *video_seek_element, *audio_sink_element;
g_return_val_if_fail (play != NULL, FALSE);
g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
@@ -632,20 +632,23 @@ gst_play_seek_to_time (GstPlay * play, gint64 time_nanos)
if (time_nanos < 0LL)
time_nanos = 0LL;
+ audio_seek_element = g_hash_table_lookup (play->priv->elements,
+ "audioconvert");
audio_sink_element = g_hash_table_lookup (play->priv->elements,
"audio_sink_element");
- video_sink_element = g_hash_table_lookup (play->priv->elements,
- "video_sink_element");
+ video_seek_element = g_hash_table_lookup (play->priv->elements,
+ "identity");
- if (GST_IS_ELEMENT (audio_sink_element) &&
- GST_IS_ELEMENT (video_sink_element)) {
+ if (GST_IS_ELEMENT (audio_seek_element) &&
+ GST_IS_ELEMENT (video_seek_element) &&
+ GST_IS_ELEMENT (audio_sink_element)) {
gboolean s = FALSE;
- s = gst_element_seek (video_sink_element, GST_FORMAT_TIME |
+ s = gst_element_seek (video_seek_element, GST_FORMAT_TIME |
GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH,
time_nanos);
if (!s) {
- s = gst_element_seek (audio_sink_element, GST_FORMAT_TIME |
+ s = gst_element_seek (audio_seek_element, GST_FORMAT_TIME |
GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH,
time_nanos);
}