assert (video_body->getFlags (i, &flags));
ADM_assert (video_body->getFlags (i, &flags));
int ADM_saveRaw (char *name){  uint32_t len, flags;  FILE *fd, *fi;  uint8_t *buffer = new uint8_t[avifileinfo->width * avifileinfo->height * 3];  char *idx;  DIA_working *work;  idx = new char[strlen (name) + 8];  strcpy (idx, name);  strcat (idx, ".idx");  fd = fopen (name, "wb");  fi = fopen (idx, "wt");  if (!fd)    return 0;  work=new DIA_working("Saving raw video stream");  // preamble  video_body->getRawStart (frameStart, buffer, &len);  fwrite (buffer, len, 1, fd);  for (uint32_t i = frameStart; i < frameEnd; i++)    {      work->update (i - frameStart, frameEnd - frameStart);      if(!work->isAlive()) goto _abt;      assert (video_body->getFlags (i, &flags));      if (flags & AVI_B_FRAME)	// oops	{	  // se search for the next i /p	  uint32_t found = 0;	  for (uint32_t j = i + 1; j < frameEnd; j++)	    {	      assert (video_body->getFlags (j, &flags));	      if (!(flags & AVI_B_FRAME))		{		  found = j;		  break;		}	    }	  if (!found)	    goto _abt;	  // Write the found frame	  video_body->getRaw (found, buffer, &len);	  fwrite (buffer, len, 1, fd);	  // and the B frames	  for (uint32_t j = i; j < found; j++)	    {	      video_body->getRaw (j, buffer, &len);	      fwrite (buffer, len, 1, fd);	    }	  i = found;		// Will be plussed by for	}      else			// P or I frame	{	  video_body->getRaw (i, buffer, &len);	  fwrite (buffer, len, 1, fd);	  fprintf (fi, "%u,\n", len);	}    }_abt:  fclose (fd);  fclose (fi);  delete work;  return 1;}