summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/modules/emotion_xine.c17
-rw-r--r--legacy/emotion/src/modules/emotion_xine.h1
2 files changed, 14 insertions, 4 deletions
diff --git a/legacy/emotion/src/modules/emotion_xine.c b/legacy/emotion/src/modules/emotion_xine.c
index a5474cdc12..100aa2b546 100644
--- a/legacy/emotion/src/modules/emotion_xine.c
+++ b/legacy/emotion/src/modules/emotion_xine.c
@@ -304,6 +304,7 @@ em_file_open(const char *file, Evas_Object *obj)
304 v = xine_get_stream_info(ev->stream, XINE_STREAM_INFO_VIDEO_RATIO); 304 v = xine_get_stream_info(ev->stream, XINE_STREAM_INFO_VIDEO_RATIO);
305 ev->ratio = (double)v / 10000.0; 305 ev->ratio = (double)v / 10000.0;
306 ev->just_loaded = 1; 306 ev->just_loaded = 1;
307 ev->get_poslen = 0;
307 308
308 { 309 {
309 pthread_attr_t thattr; 310 pthread_attr_t thattr;
@@ -320,6 +321,8 @@ em_file_open(const char *file, Evas_Object *obj)
320 pthread_attr_init(&thattr); 321 pthread_attr_init(&thattr);
321 pthread_create(&ev->get_pos_len_th, NULL, _em_get_pos_len_th, ev); 322 pthread_create(&ev->get_pos_len_th, NULL, _em_get_pos_len_th, ev);
322 pthread_attr_destroy(&thattr); 323 pthread_attr_destroy(&thattr);
324
325 ev->get_pos_thread_deleted = 0;
323 } 326 }
324// em_debug(ev); 327// em_debug(ev);
325 return ev; 328 return ev;
@@ -334,10 +337,15 @@ em_file_close(void *ef)
334 ev->delete_me = 1; 337 ev->delete_me = 1;
335// pthread_mutex_lock(&(ev->seek_mutex)); 338// pthread_mutex_lock(&(ev->seek_mutex));
336 pthread_cond_broadcast(&(ev->seek_cond)); 339 pthread_cond_broadcast(&(ev->seek_cond));
337// pthread_mutex_lock(&(ev->get_pos_len_mutex));
338 pthread_cond_broadcast(&(ev->get_pos_len_cond));
339 while (ev->seek_to); 340 while (ev->seek_to);
340 while (ev->get_poslen); 341
342// pthread_mutex_lock(&(ev->get_pos_len_mutex));
343 if (!ev->get_pos_thread_deleted)
344 {
345 pthread_cond_broadcast(&(ev->get_pos_len_cond));
346 while (ev->get_poslen);
347 }
348
341 printf("EX pause end...\n"); 349 printf("EX pause end...\n");
342 if (!emotion_object_play_get(ev->obj)) 350 if (!emotion_object_play_get(ev->obj))
343// if (xine_get_param(ev->stream, XINE_PARAM_SPEED) == XINE_SPEED_PAUSE) 351// if (xine_get_param(ev->stream, XINE_PARAM_SPEED) == XINE_SPEED_PAUSE)
@@ -1269,7 +1277,7 @@ _em_get_pos_len_th(void *par)
1269 for (;;) 1277 for (;;)
1270 { 1278 {
1271 pthread_cond_wait(&(ev->get_pos_len_cond), &(ev->get_pos_len_mutex)); 1279 pthread_cond_wait(&(ev->get_pos_len_cond), &(ev->get_pos_len_mutex));
1272 while (ev->get_poslen > 0) 1280 while (ev->get_poslen > 0 || ev->delete_me)
1273 { 1281 {
1274 int pos_stream = 0; 1282 int pos_stream = 0;
1275 int pos_time = 0; 1283 int pos_time = 0;
@@ -1296,6 +1304,7 @@ _em_get_pos_len_th(void *par)
1296 if (ev->delete_me) 1304 if (ev->delete_me)
1297 { 1305 {
1298 ev->get_poslen = 0; 1306 ev->get_poslen = 0;
1307 ev->get_pos_thread_deleted = 1;
1299 return NULL; 1308 return NULL;
1300 } 1309 }
1301 ev->get_poslen = 0; 1310 ev->get_poslen = 0;
diff --git a/legacy/emotion/src/modules/emotion_xine.h b/legacy/emotion/src/modules/emotion_xine.h
index 60a7dc4aae..8025cad9da 100644
--- a/legacy/emotion/src/modules/emotion_xine.h
+++ b/legacy/emotion/src/modules/emotion_xine.h
@@ -49,6 +49,7 @@ struct _Emotion_Xine_Video
49 pthread_cond_t get_pos_len_cond; 49 pthread_cond_t get_pos_len_cond;
50 pthread_mutex_t seek_mutex; 50 pthread_mutex_t seek_mutex;
51 pthread_mutex_t get_pos_len_mutex; 51 pthread_mutex_t get_pos_len_mutex;
52 unsigned char get_pos_thread_deleted : 1;
52}; 53};
53 54
54struct _Emotion_Xine_Video_Frame 55struct _Emotion_Xine_Video_Frame