예제 #1
0
int mpeg3io_open_file(mpeg3_fs_t *fs)
{
/* Need to perform authentication before reading a single byte. */
	mpeg3_get_keys(fs->css, fs->path);

//printf("mpeg3io_open_file 1 %s\n", fs->path);
	if(!(fs->fd = fopen64(fs->path, "rb")))
	{
		if (fs->path) fprintf(stderr,"[mpeg3io_open_file] Error opening file '%s': ",fs->path);
		perror("");
		return 1;
	}

	fs->total_bytes = mpeg3io_get_total_bytes(fs);

	if(!fs->total_bytes)
	{
		fclose(fs->fd);
		return 1;
	}

	fs->current_byte = 0;
	fs->buffer_position = -0xffff;
	return 0;
}
예제 #2
0
파일: mpeg3io.c 프로젝트: opieproject/opie
int mpeg3io_open_file(mpeg3_fs_t *fs)
{
/* Need to perform authentication before reading a single byte. */
  mpeg3_get_keys(fs->css, fs->path);

  if(!(fs->fd = fopen(fs->path, "rb")))
  {
    perror("mpeg3io_open_file");
    return 1;
  }

  fs->total_bytes = mpeg3io_get_total_bytes(fs);

  if(!fs->total_bytes)
  {
    fclose(fs->fd);
    return 1;
  }
  fs->current_byte = 0;
  return 0;
}