_file_open(ev);
}
-static int
-_em_read_safe(int fd, void *buf, ssize_t size)
-{
- ssize_t todo;
- char *p;
-
- todo = size;
- p = buf;
-
- while (todo > 0)
- {
- ssize_t r;
-
- r = read(fd, p, todo);
- if (r > 0)
- {
- todo -= r;
- p += r;
- }
- else if (r == 0)
- return 0;
- else
- {
- if (errno == EINTR || errno == EAGAIN)
- return size - todo;
- else
- {
- ERR("could not read from fd %d: %s", fd, strerror(errno));
- return -1;
- }
- }
- }
-
- return size;
-}
-
static Eina_Bool
_player_cmd_param_read(Emotion_Generic_Video *ev, void *param, size_t size)
{
return EINA_FALSE;
}
-static Eina_Bool
-_player_int_read(Emotion_Generic_Video *ev, int *i)
-{
- int n;
- n = _em_read_safe(ev->fd_read, i, sizeof(*i));
- if (n <= 0)
- {
- ERR("could not read int from fd_read %d\n", ev->fd_read);
- return EINA_FALSE;
- }
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_player_str_read(Emotion_Generic_Video *ev, char *str, int *len)
-{
- int n;
-
- if (!_player_int_read(ev, len))
- return EINA_FALSE;
-
- n = _em_read_safe(ev->fd_read, str, *len);
- if (n <= 0)
- {
- ERR("could not read string from fd_read %d\n", ev->fd_read);
- return EINA_FALSE;
- }
-
- return EINA_TRUE;
-}
-
static void
_player_frame_resize(Emotion_Generic_Video *ev)
{
}
static void
-_player_helper_str_read(Emotion_Generic_Video *ev, const char **pstr)
-{
- int len;
- char buf[PATH_MAX];
- if (_player_str_read(ev, buf, &len))
- *pstr = eina_stringshare_add_length(buf, len);
-}
-
-static void
_player_meta_info_free(Emotion_Generic_Video *ev)
{
eina_stringshare_replace(&ev->meta.title, NULL);
_player_cmd_track_info(Emotion_Generic_Video *ev)
{
int param;
- Eina_Bool r;
int i;
if (ev->cmd.num_params == 0)
Emotion_Generic_Video *ev = data;
if (!ev || !ev->file_ready)
- return;
+ return 0;
// lock frame here
sem_wait(&ev->shared->lock);