[FFmpeg-soc] [soc]: r2892 - mxf/mxfenc.c
Aurelien Jacobs
aurel at gnuage.org
Tue Jul 29 19:27:47 CEST 2008
spyfeng wrote:
> Author: spyfeng
> Date: Tue Jul 29 15:45:34 2008
> New Revision: 2892
>
> Log:
> simplify mxf_generate_uuid()
>
>
> Modified:
> mxf/mxfenc.c
>
> Modified: mxf/mxfenc.c
> ==============================================================================
> --- mxf/mxfenc.c (original)
> +++ mxf/mxfenc.c Tue Jul 29 15:45:34 2008
> @@ -230,21 +230,16 @@ static void mxf_generate_uuid(AVFormatCo
>
> for (i = 0; i < 16; i++) {
> rand_num = av_random(&mxf->random_state);
> - rand_num = rand_num & 0x00ff;
> -
> - // the 7th byte is version according to ISO 11578
> - if (i == 6) {
> - rand_num &= 0x0f;
> - rand_num |= 0x40;
> - }
> -
> - // the 8th byte is variant for current use according to ISO 11578
> - if (i == 8) {
> - rand_num &= 0x3f;
> - rand_num |= 0x80;
> - }
> + rand_num &= 0x00ff;
> uuid[i] = rand_num;
> }
> + // the 7th byte is version according to ISO 11578
> + uuid[6] &= 0x0f;
> + uuid[6] &= 0x40;
This is not equivalent to the previous code (& vs. |), and
your new code is basically the same as uuid[6]=0;
Aurel
More information about the FFmpeg-soc
mailing list