|
From: Sandro S. <st...@ke...> - 2011-05-07 06:38:32
|
Could very well be a bug.
I kind of remember being unable to "output-to-memory" since 0.2a !!
See if SWFMovie_output() works fine (to stdout) to restrict the research.
Patches are welcome.
--strk;
On Mon, Apr 11, 2011 at 09:53:35AM +0200, Axel Huizinga wrote:
> Hi,
> could need some advice while trying to get the movie as byte array with
> SWFMovie_output_to_stream
> but the result is smaller than the output from SWFMovie which loads
> correct in the flashplayer while the former does not.
> Maybe I made a mistake - the code below traces:
>
> streamed size:24 = 24 string:FWS
> saved size:28
>
>
>
> #define _GNU_SOURCE
> #include <ming.h>
> #include <stdlib.h>
> #include <string.h>
>
> int main()
> {
> SWFMovie movie;
> char *bp;
> FILE *stream;
> size_t size;
> int ssize;
> movie = newSWFMovie();
>
> stream = open_memstream(&bp, &size);
> if (stream == NULL)
> {
> printf("oops - couldn't open memstream :-(\n");
> return 1;
> }
> ssize = SWFMovie_output_to_stream(movie, stream);
> fclose(stream);
>
> printf("streamed size:%i = %i string:%s\n",ssize, size, bp);
> FILE *fo = fopen("string.swf", "w");
> int i;
> for(i=0;i<size;i++)
> fputc(bp[i], fo);
> fclose(fo);
> free(bp);
>
> ssize = SWFMovie_save(movie, "saved.swf");
> printf("saved size:%i \n",ssize);
> return 0;
> }
>
>
>
>
> ------------------------------------------------------------------------------
> Xperia(TM) PLAY
> It's a major breakthrough. An authentic gaming
> smartphone on the nation's most reliable network.
> And it wants your games.
> http://p.sf.net/sfu/verizon-sfdev
> _______________________________________________
> Ming-devr mailing list
> Min...@li...
> https://lists.sourceforge.net/lists/listinfo/ming-devr
--
What comes next is just spam, don't bother scrolling
|