summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
diff options
context:
space:
mode:
authorRafael Antognolli <antognolli@gmail.com>2011-09-05 16:07:00 +0000
committerRafael Antognolli <antognolli@gmail.com>2011-09-05 16:07:00 +0000
commitdca7c873b23c8f029e8cac549a64a62fc5c4969c (patch)
tree6901b82a084b06e3a17f2344c03c683aa7728c53 /legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
parentce8904076d03e72551e80ea83e893ebee57dcd4f (diff)
emotion/generic - Don't start opening new file when another one is being open.
SVN revision: 63203
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c b/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
index 425aeb4d60..a29793151e 100644
--- a/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
+++ b/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
@@ -373,6 +373,13 @@ _event_cb(const struct libvlc_event_t *ev, void *data)
373static void 373static void
374_file_set(struct _App *app) 374_file_set(struct _App *app)
375{ 375{
376 if (app->opening)
377 {
378 libvlc_media_release(app->m);
379 libvlc_media_player_release(app->mp);
380 free(app->filename);
381 }
382
376 _em_str_read(app->em_read, &app->filename); 383 _em_str_read(app->em_read, &app->filename);
377 384
378 app->m = libvlc_media_new_path(app->libvlc, app->filename); 385 app->m = libvlc_media_new_path(app->libvlc, app->filename);
@@ -514,6 +521,9 @@ static void
514_file_close(struct _App *app) 521_file_close(struct _App *app)
515{ 522{
516 app->playing = 0; 523 app->playing = 0;
524 if (app->opening)
525 goto release_resources;
526
517 if (libvlc_media_player_get_state(app->mp) != libvlc_Playing) 527 if (libvlc_media_player_get_state(app->mp) != libvlc_Playing)
518 { 528 {
519 _send_file_closed(app); 529 _send_file_closed(app);
@@ -521,6 +531,8 @@ _file_close(struct _App *app)
521 } 531 }
522 532
523 app->closing = 1; 533 app->closing = 1;
534
535release_resources:
524 libvlc_media_player_stop(app->mp); 536 libvlc_media_player_stop(app->mp);
525 if (app->filename) 537 if (app->filename)
526 free(app->filename); 538 free(app->filename);