static void
_player_new_frame(Emotion_Generic_Video *ev)
{
- if (ev->opening || ev->closing)
+ if (!ev->file_ready)
return;
_emotion_frame_new(ev->obj);
}
return;
}
+ ev->file_ready = EINA_TRUE;
+
_emotion_open_done(ev->obj);
if (ev->play)
_player_send_float(ev, ev->pos);
}
+ _player_send_cmd(ev, EM_CMD_VOLUME_SET);
+ _player_send_float(ev, ev->volume);
+
+ _player_send_cmd(ev, EM_CMD_SPEED_SET);
+ _player_send_float(ev, ev->speed);
+
+ int mute = ev->audio_mute;
+ _player_send_cmd(ev, EM_CMD_AUDIO_MUTE_SET);
+ _player_send_int(ev, mute);
+
+ mute = ev->video_mute;
+ _player_send_cmd(ev, EM_CMD_VIDEO_MUTE_SET);
+ _player_send_int(ev, mute);
+
+ mute = ev->spu_mute;
+ _player_send_cmd(ev, EM_CMD_SPU_MUTE_SET);
+ _player_send_int(ev, mute);
+
INF("Open done");
}
ev->player.exe = NULL;
ev->ready = EINA_FALSE;
+ ev->file_ready = EINA_FALSE;
ecore_main_fd_handler_del(ev->fd_handler);
close(ev->fd_read);
close(ev->fd_write);
ev->w = 0;
ev->h = 0;
ev->ratio = 1;
- ev->speed = 1.0;
ev->len = 0;
if (ev->ready && ev->opening)
ev->play = EINA_FALSE;
- if (!ev->ready)
+ if (!ev->file_ready)
return;
_player_send_cmd(ev, EM_CMD_STOP);
{
Emotion_Generic_Video *ev = data;
float position = pos;
+
+ if (!ev->file_ready)
+ return;
+
_player_send_cmd(ev, EM_CMD_POSITION_SET);
_player_send_float(ev, position);
_emotion_seek_done(ev->obj);
{
Emotion_Generic_Video *ev = data;
- if (!ev || ev->opening || ev->closing)
- return 0;
+ if (!ev || !ev->file_ready)
+ return;
// lock frame here
sem_wait(&ev->shared->lock);
em_video_channel_mute_set(void *data, int mute)
{
Emotion_Generic_Video *ev = data;
+
+ ev->video_mute = !!mute;
+
+ if (!ev || !ev->file_ready)
+ return;
+
_player_send_cmd(ev, EM_CMD_VIDEO_MUTE_SET);
_player_send_int(ev, mute);
- ev->video_mute = !!mute;
}
static int
em_audio_channel_mute_set(void *data, int mute)
{
Emotion_Generic_Video *ev = data;
+
+ ev->audio_mute = !!mute;
+
+ if (!ev || !ev->file_ready)
+ return;
+
_player_send_cmd(ev, EM_CMD_AUDIO_MUTE_SET);
_player_send_int(ev, mute);
- ev->audio_mute = !!mute;
}
static int
em_audio_channel_volume_set(void *data, double vol)
{
Emotion_Generic_Video *ev = data;
- float fvol;
if (vol > 1.0) vol = 1.0;
if (vol < 0.0) vol = 0.0;
- fvol = vol;
- _player_send_cmd(ev, EM_CMD_VOLUME_SET);
- _player_send_float(ev, fvol);
-
ev->volume = vol;
+
+ if (!ev || !ev->file_ready)
+ return;
+
+ _player_send_cmd(ev, EM_CMD_VOLUME_SET);
+ _player_send_float(ev, ev->volume);
}
static double
em_spu_channel_mute_set(void *data, int mute)
{
Emotion_Generic_Video *ev = data;
+
+ ev->spu_mute = !!mute;
+
+ if (!ev || !ev->file_ready)
+ return;
+
_player_send_cmd(ev, EM_CMD_SPU_MUTE_SET);
_player_send_int(ev, mute);
- ev->spu_mute = !!mute;
}
static int
{
Emotion_Generic_Video *ev = data;
float rate = speed;
+ ev->speed = rate;
+
+ if (!ev || !ev->file_ready)
+ return;
_player_send_cmd(ev, EM_CMD_SPEED_SET);
_player_send_float(ev, rate);
-
- ev->speed = rate;
}
static double