Created
October 24, 2014 19:19
-
-
Save bvibber/16a65e610fc25ac53bb9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* theora is one in, one out... */ | |
if (ogg_stream_packetpeek(&theoraStreamState, &videoPacket) > 0) { | |
videobufReady = 1; | |
videobufGranulepos = videoPacket.granulepos; | |
videobufTime = th_granule_time(theoraDecoderContext, videobufGranulepos); | |
keyframeGranulepos = (videobufGranulepos >> theoraInfo.keyframe_granule_shift) << theoraInfo.keyframe_granule_shift; | |
keyframeTime = th_granule_time(theoraDecoderContext, keyframeGranulepos); | |
printf("granulepos: %llx; time %lf; offset %d\n",(unsigned long long)videobufGranulepos, (double)videobufTime, (int)theoraInfo.keyframe_granule_shift); | |
OgvJsOutputFrameReady(videobufTime, keyframeTime); | |
} else { | |
needData = 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment