summaryrefslogtreecommitdiff
path: root/legacy/emotion
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2004-07-21 06:34:18 +0000
committerCarsten Haitzler <raster@rasterman.com>2004-07-21 06:34:18 +0000
commit019ae2a3103e65e8f82efab259a3659fdf1e670f (patch)
tree2a5cdf055f25e1ddd44f52a331a490907ef73dd5 /legacy/emotion
parent3e8511b2f395722d79e0ecc271dd6b98cebf1232 (diff)
hmm - handle fstreams where xine dosnt report absolute length - just a
percentage position SVN revision: 10951
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/modules/emotion_xine.c28
-rw-r--r--legacy/emotion/src/modules/emotion_xine.h5
2 files changed, 25 insertions, 8 deletions
diff --git a/legacy/emotion/src/modules/emotion_xine.c b/legacy/emotion/src/modules/emotion_xine.c
index af1f71cb8e..8f7de4b53f 100644
--- a/legacy/emotion/src/modules/emotion_xine.c
+++ b/legacy/emotion/src/modules/emotion_xine.c
@@ -979,13 +979,20 @@ _em_seek(void *par)
979 { 979 {
980 again: 980 again:
981 ppos = ev->seek_to_pos; 981 ppos = ev->seek_to_pos;
982 xine_play(ev->stream, 0, ppos * 1000); 982 if (ppos > ev->len) ppos = ev->len;
983 if (ev->no_time)
984 xine_play(ev->stream, ppos * 65535, 0);
985 else
986 xine_play(ev->stream, 0, ppos * 1000);
983 ev->seek_to = 0; 987 ev->seek_to = 0;
984 if (ev->delete_me) return NULL; 988 if (ev->delete_me) return NULL;
985 } 989 }
986 if (!ev->play) 990 if (!ev->play)
987 xine_set_param(ev->stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE); 991 {
992 xine_set_param(ev->stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE);
993 }
988 if (ev->delete_me) return NULL; 994 if (ev->delete_me) return NULL;
995 usleep(1000000 / 10);
989 if (ppos != ev->seek_to_pos) 996 if (ppos != ev->seek_to_pos)
990 goto again; 997 goto again;
991 } 998 }
@@ -1227,9 +1234,18 @@ _em_get_pos_len_th(void *par)
1227 &pos_time, 1234 &pos_time,
1228 &length_time)) 1235 &length_time))
1229 { 1236 {
1230 1237 if (length_time == 0)
1231 ev->pos = (double)pos_time / 1000.0; 1238 {
1232 ev->len = (double)length_time / 1000.0; 1239 ev->pos = (double)pos_stream / 65535;
1240 ev->len = 1.0;
1241 ev->no_time = 1;
1242 }
1243 else
1244 {
1245 ev->pos = (double)pos_time / 1000.0;
1246 ev->len = (double)length_time / 1000.0;
1247 ev->no_time = 0;
1248 }
1233 } 1249 }
1234 if (ev->delete_me) 1250 if (ev->delete_me)
1235 { 1251 {
@@ -1238,7 +1254,7 @@ _em_get_pos_len_th(void *par)
1238 } 1254 }
1239 ev->get_poslen = 0; 1255 ev->get_poslen = 0;
1240// printf("get pos %3.3f\n", ev->pos); 1256// printf("get pos %3.3f\n", ev->pos);
1241 usleep(1000000 / 10); 1257 usleep(1000000 / 15);
1242 } 1258 }
1243 } 1259 }
1244 return NULL; 1260 return NULL;
diff --git a/legacy/emotion/src/modules/emotion_xine.h b/legacy/emotion/src/modules/emotion_xine.h
index 8b9f2a7080..fe3bee5717 100644
--- a/legacy/emotion/src/modules/emotion_xine.h
+++ b/legacy/emotion/src/modules/emotion_xine.h
@@ -17,8 +17,8 @@ struct _Emotion_Xine_Video
17 xine_stream_t *stream; 17 xine_stream_t *stream;
18 xine_event_queue_t *queue; 18 xine_event_queue_t *queue;
19 int fd; 19 int fd;
20 double len; 20 volatile double len;
21 double pos; 21 volatile double pos;
22 double fps; 22 double fps;
23 double ratio; 23 double ratio;
24 int w, h; 24 int w, h;
@@ -40,6 +40,7 @@ struct _Emotion_Xine_Video
40 unsigned char audio_mute : 1; 40 unsigned char audio_mute : 1;
41 unsigned char spu_mute : 1; 41 unsigned char spu_mute : 1;
42 volatile unsigned char delete_me : 1; 42 volatile unsigned char delete_me : 1;
43 volatile unsigned char no_time : 1;
43 44
44 pthread_t seek_th; 45 pthread_t seek_th;
45 pthread_t get_pos_len_th; 46 pthread_t get_pos_len_th;