static int yuv4_read_header(AVFormatContext *s, AVFormatParameters *ap)

{

    char header[MAX_YUV4_HEADER+10];  // Include headroom for the longest option

    char *tokstart,*tokend,*header_end;

    int i;

    ByteIOContext *pb = s->pb;

    int width=-1, height=-1, raten=0, rated=0, aspectn=0, aspectd=0;

    enum PixelFormat pix_fmt=PIX_FMT_NONE,alt_pix_fmt=PIX_FMT_NONE;

    enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;

    AVStream *st;

    struct frame_attributes *s1 = s->priv_data;



    for (i=0; i<MAX_YUV4_HEADER; i++) {

        header[i] = get_byte(pb);

        if (header[i] == '\n') {

            header[i+1] = 0x20;  // Add a space after last option. Makes parsing "444" vs "444alpha" easier.

            header[i+2] = 0;

            break;

        }

    }

    if (i == MAX_YUV4_HEADER) return -1;

    if (strncmp(header, Y4M_MAGIC, strlen(Y4M_MAGIC))) return -1;



    s1->interlaced_frame = 0;

    s1->top_field_first = 0;

    header_end = &header[i+1]; // Include space

    for(tokstart = &header[strlen(Y4M_MAGIC) + 1]; tokstart < header_end; tokstart++) {

        if (*tokstart==0x20) continue;

        switch (*tokstart++) {

        case 'W': // Width. Required.

            width = strtol(tokstart, &tokend, 10);

            tokstart=tokend;

            break;

        case 'H': // Height. Required.

            height = strtol(tokstart, &tokend, 10);

            tokstart=tokend;

            break;

        case 'C': // Color space

            if (strncmp("420jpeg",tokstart,7)==0) {

                pix_fmt = PIX_FMT_YUV420P;

                chroma_sample_location = AVCHROMA_LOC_CENTER;

            } else if (strncmp("420mpeg2",tokstart,8)==0) {

                pix_fmt = PIX_FMT_YUV420P;

                chroma_sample_location = AVCHROMA_LOC_LEFT;

            } else if (strncmp("420paldv", tokstart, 8)==0) {

                pix_fmt = PIX_FMT_YUV420P;

                chroma_sample_location = AVCHROMA_LOC_TOPLEFT;

            } else if (strncmp("411", tokstart, 3)==0)

                pix_fmt = PIX_FMT_YUV411P;

            else if (strncmp("422", tokstart, 3)==0)

                pix_fmt = PIX_FMT_YUV422P;

            else if (strncmp("444alpha", tokstart, 8)==0) {

                av_log(s, AV_LOG_ERROR, "Cannot handle 4:4:4:4 YUV4MPEG stream.\n");

                return -1;

            } else if (strncmp("444", tokstart, 3)==0)

                pix_fmt = PIX_FMT_YUV444P;

            else if (strncmp("mono",tokstart, 4)==0) {

                pix_fmt = PIX_FMT_GRAY8;

            } else {

                av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown pixel format.\n");

                return -1;

            }

            while(tokstart<header_end&&*tokstart!=0x20) tokstart++;

            break;

        case 'I': // Interlace type

            switch (*tokstart++){

            case '?':

                break;

            case 'p':

                s1->interlaced_frame=0;

                break;

            case 't':

                s1->interlaced_frame=1;

                s1->top_field_first=1;

                break;

            case 'b':

                s1->interlaced_frame=1;

                s1->top_field_first=0;

                break;

            case 'm':

                av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains mixed interlaced and non-interlaced frames.\n");

                return -1;

            default:

                av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n");

                return -1;

            }

            break;

        case 'F': // Frame rate

            sscanf(tokstart,"%d:%d",&raten,&rated); // 0:0 if unknown

            while(tokstart<header_end&&*tokstart!=0x20) tokstart++;

            break;

        case 'A': // Pixel aspect

            sscanf(tokstart,"%d:%d",&aspectn,&aspectd); // 0:0 if unknown

            while(tokstart<header_end&&*tokstart!=0x20) tokstart++;

            break;

        case 'X': // Vendor extensions

            if (strncmp("YSCSS=",tokstart,6)==0) {

                // Older nonstandard pixel format representation

                tokstart+=6;

                if (strncmp("420JPEG",tokstart,7)==0)

                    alt_pix_fmt=PIX_FMT_YUV420P;

                else if (strncmp("420MPEG2",tokstart,8)==0)

                    alt_pix_fmt=PIX_FMT_YUV420P;

                else if (strncmp("420PALDV",tokstart,8)==0)

                    alt_pix_fmt=PIX_FMT_YUV420P;

                else if (strncmp("411",tokstart,3)==0)

                    alt_pix_fmt=PIX_FMT_YUV411P;

                else if (strncmp("422",tokstart,3)==0)

                    alt_pix_fmt=PIX_FMT_YUV422P;

                else if (strncmp("444",tokstart,3)==0)

                    alt_pix_fmt=PIX_FMT_YUV444P;

            }

            while(tokstart<header_end&&*tokstart!=0x20) tokstart++;

            break;

        }

    }



    if ((width == -1) || (height == -1)) {

        av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n");

        return -1;

    }



    if (pix_fmt == PIX_FMT_NONE) {

        if (alt_pix_fmt == PIX_FMT_NONE)

            pix_fmt = PIX_FMT_YUV420P;

        else

            pix_fmt = alt_pix_fmt;

    }



    if (raten == 0 && rated == 0) {

        // Frame rate unknown

        raten = 25;

        rated = 1;

    }



    if (aspectn == 0 && aspectd == 0) {

        // Pixel aspect unknown

        aspectd = 1;

    }



    st = av_new_stream(s, 0);

    if(!st)

        return AVERROR(ENOMEM);

    st->codec->width = width;

    st->codec->height = height;

    av_reduce(&raten, &rated, raten, rated, (1UL<<31)-1);

    av_set_pts_info(st, 64, rated, raten);

    st->codec->pix_fmt = pix_fmt;

    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;

    st->codec->codec_id = CODEC_ID_RAWVIDEO;

    st->sample_aspect_ratio= (AVRational){aspectn, aspectd};

    st->codec->chroma_sample_location = chroma_sample_location;



    return 0;

}

static int yuv4_read_header(AVFormatContext *s, AVFormatParameters *ap)

{

    char header[MAX_YUV4_HEADER+10];  

    char *tokstart,*tokend,*header_end;

    int i;

    ByteIOContext *pb = s->pb;

    int width=-1, height=-1, raten=0, rated=0, aspectn=0, aspectd=0;

    enum PixelFormat pix_fmt=PIX_FMT_NONE,alt_pix_fmt=PIX_FMT_NONE;

    enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;

    AVStream *st;

    struct frame_attributes *s1 = s->priv_data;



    for (i=0; i<MAX_YUV4_HEADER; i++) {

        header[i] = get_byte(pb);

        if (header[i] == '\n') {

            header[i+1] = 0x20;  

            header[i+2] = 0;

            break;

        }

    }

    if (i == MAX_YUV4_HEADER) return -1;

    if (strncmp(header, Y4M_MAGIC, strlen(Y4M_MAGIC))) return -1;



    s1->interlaced_frame = 0;

    s1->top_field_first = 0;

    header_end = &header[i+1]; 

    for(tokstart = &header[strlen(Y4M_MAGIC) + 1]; tokstart < header_end; tokstart++) {

        if (*tokstart==0x20) continue;

        switch (*tokstart++) {

        case 'W': 

            width = strtol(tokstart, &tokend, 10);

            tokstart=tokend;

            break;

        case 'H': 

            height = strtol(tokstart, &tokend, 10);

            tokstart=tokend;

            break;

        case 'C': 

            if (strncmp("420jpeg",tokstart,7)==0) {

                pix_fmt = PIX_FMT_YUV420P;

                chroma_sample_location = AVCHROMA_LOC_CENTER;

            } else if (strncmp("420mpeg2",tokstart,8)==0) {

                pix_fmt = PIX_FMT_YUV420P;

                chroma_sample_location = AVCHROMA_LOC_LEFT;

            } else if (strncmp("420paldv", tokstart, 8)==0) {

                pix_fmt = PIX_FMT_YUV420P;

                chroma_sample_location = AVCHROMA_LOC_TOPLEFT;

            } else if (strncmp("411", tokstart, 3)==0)

                pix_fmt = PIX_FMT_YUV411P;

            else if (strncmp("422", tokstart, 3)==0)

                pix_fmt = PIX_FMT_YUV422P;

            else if (strncmp("444alpha", tokstart, 8)==0) {

                av_log(s, AV_LOG_ERROR, "Cannot handle 4:4:4:4 YUV4MPEG stream.\n");

                return -1;

            } else if (strncmp("444", tokstart, 3)==0)

                pix_fmt = PIX_FMT_YUV444P;

            else if (strncmp("mono",tokstart, 4)==0) {

                pix_fmt = PIX_FMT_GRAY8;

            } else {

                av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown pixel format.\n");

                return -1;

            }

            while(tokstart<header_end&&*tokstart!=0x20) tokstart++;

            break;

        case 'I': 

            switch (*tokstart++){

            case '?':

                break;

            case 'p':

                s1->interlaced_frame=0;

                break;

            case 't':

                s1->interlaced_frame=1;

                s1->top_field_first=1;

                break;

            case 'b':

                s1->interlaced_frame=1;

                s1->top_field_first=0;

                break;

            case 'm':

                av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains mixed interlaced and non-interlaced frames.\n");

                return -1;

            default:

                av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n");

                return -1;

            }

            break;

        case 'F': 

            sscanf(tokstart,"%d:%d",&raten,&rated); 

            while(tokstart<header_end&&*tokstart!=0x20) tokstart++;

            break;

        case 'A': 

            sscanf(tokstart,"%d:%d",&aspectn,&aspectd); 

            while(tokstart<header_end&&*tokstart!=0x20) tokstart++;

            break;

        case 'X': 

            if (strncmp("YSCSS=",tokstart,6)==0) {

                

                tokstart+=6;

                if (strncmp("420JPEG",tokstart,7)==0)

                    alt_pix_fmt=PIX_FMT_YUV420P;

                else if (strncmp("420MPEG2",tokstart,8)==0)

                    alt_pix_fmt=PIX_FMT_YUV420P;

                else if (strncmp("420PALDV",tokstart,8)==0)

                    alt_pix_fmt=PIX_FMT_YUV420P;

                else if (strncmp("411",tokstart,3)==0)

                    alt_pix_fmt=PIX_FMT_YUV411P;

                else if (strncmp("422",tokstart,3)==0)

                    alt_pix_fmt=PIX_FMT_YUV422P;

                else if (strncmp("444",tokstart,3)==0)

                    alt_pix_fmt=PIX_FMT_YUV444P;

            }

            while(tokstart<header_end&&*tokstart!=0x20) tokstart++;

            break;

        }

    }



    if ((width == -1) || (height == -1)) {

        av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n");

        return -1;

    }



    if (pix_fmt == PIX_FMT_NONE) {

        if (alt_pix_fmt == PIX_FMT_NONE)

            pix_fmt = PIX_FMT_YUV420P;

        else

            pix_fmt = alt_pix_fmt;

    }



    if (raten == 0 && rated == 0) {

         unknown

        raten = 25;

        rated = 1;

    }



    if (aspectn == 0 && aspectd == 0) {

         unknown

        aspectd = 1;

    }



    st = av_new_stream(s, 0);

    if(!st)

        return AVERROR(ENOMEM);

    st->codec->width = width;

    st->codec->height = height;

    av_reduce(&raten, &rated, raten, rated, (1UL<<31)-1);

    av_set_pts_info(st, 64, rated, raten);

    st->codec->pix_fmt = pix_fmt;

    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;

    st->codec->codec_id = CODEC_ID_RAWVIDEO;

    st->sample_aspect_ratio= (AVRational){aspectn, aspectd};

    st->codec->chroma_sample_location = chroma_sample_location;



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVFormatParameters *VAR_1)

{

    char VAR_2[MAX_YUV4_HEADER+10];  

    char *VAR_3,*VAR_4,*VAR_5;

    int VAR_6;

    ByteIOContext *pb = VAR_0->pb;

    int VAR_7=-1, VAR_8=-1, VAR_9=0, VAR_10=0, VAR_11=0, VAR_12=0;

    enum PixelFormat VAR_13=PIX_FMT_NONE,VAR_14=PIX_FMT_NONE;

    enum AVChromaLocation VAR_15 = AVCHROMA_LOC_UNSPECIFIED;

    AVStream *st;

    struct frame_attributes *VAR_16 = VAR_0->priv_data;



    for (VAR_6=0; VAR_6<MAX_YUV4_HEADER; VAR_6++) {

        VAR_2[VAR_6] = get_byte(pb);

        if (VAR_2[VAR_6] == '\n') {

            VAR_2[VAR_6+1] = 0x20;  

            VAR_2[VAR_6+2] = 0;

            break;

        }

    }

    if (VAR_6 == MAX_YUV4_HEADER) return -1;

    if (strncmp(VAR_2, Y4M_MAGIC, strlen(Y4M_MAGIC))) return -1;



    VAR_16->interlaced_frame = 0;

    VAR_16->top_field_first = 0;

    VAR_5 = &VAR_2[VAR_6+1]; 

    for(VAR_3 = &VAR_2[strlen(Y4M_MAGIC) + 1]; VAR_3 < VAR_5; VAR_3++) {

        if (*VAR_3==0x20) continue;

        switch (*VAR_3++) {

        case 'W': 

            VAR_7 = strtol(VAR_3, &VAR_4, 10);

            VAR_3=VAR_4;

            break;

        case 'H': 

            VAR_8 = strtol(VAR_3, &VAR_4, 10);

            VAR_3=VAR_4;

            break;

        case 'C': 

            if (strncmp("420jpeg",VAR_3,7)==0) {

                VAR_13 = PIX_FMT_YUV420P;

                VAR_15 = AVCHROMA_LOC_CENTER;

            } else if (strncmp("420mpeg2",VAR_3,8)==0) {

                VAR_13 = PIX_FMT_YUV420P;

                VAR_15 = AVCHROMA_LOC_LEFT;

            } else if (strncmp("420paldv", VAR_3, 8)==0) {

                VAR_13 = PIX_FMT_YUV420P;

                VAR_15 = AVCHROMA_LOC_TOPLEFT;

            } else if (strncmp("411", VAR_3, 3)==0)

                VAR_13 = PIX_FMT_YUV411P;

            else if (strncmp("422", VAR_3, 3)==0)

                VAR_13 = PIX_FMT_YUV422P;

            else if (strncmp("444alpha", VAR_3, 8)==0) {

                av_log(VAR_0, AV_LOG_ERROR, "Cannot handle 4:4:4:4 YUV4MPEG stream.\n");

                return -1;

            } else if (strncmp("444", VAR_3, 3)==0)

                VAR_13 = PIX_FMT_YUV444P;

            else if (strncmp("mono",VAR_3, 4)==0) {

                VAR_13 = PIX_FMT_GRAY8;

            } else {

                av_log(VAR_0, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown pixel format.\n");

                return -1;

            }

            while(VAR_3<VAR_5&&*VAR_3!=0x20) VAR_3++;

            break;

        case 'I': 

            switch (*VAR_3++){

            case '?':

                break;

            case 'p':

                VAR_16->interlaced_frame=0;

                break;

            case 't':

                VAR_16->interlaced_frame=1;

                VAR_16->top_field_first=1;

                break;

            case 'b':

                VAR_16->interlaced_frame=1;

                VAR_16->top_field_first=0;

                break;

            case 'm':

                av_log(VAR_0, AV_LOG_ERROR, "YUV4MPEG stream contains mixed interlaced and non-interlaced frames.\n");

                return -1;

            default:

                av_log(VAR_0, AV_LOG_ERROR, "YUV4MPEG has invalid VAR_2.\n");

                return -1;

            }

            break;

        case 'F': 

            sscanf(VAR_3,"%d:%d",&VAR_9,&VAR_10); 

            while(VAR_3<VAR_5&&*VAR_3!=0x20) VAR_3++;

            break;

        case 'A': 

            sscanf(VAR_3,"%d:%d",&VAR_11,&VAR_12); 

            while(VAR_3<VAR_5&&*VAR_3!=0x20) VAR_3++;

            break;

        case 'X': 

            if (strncmp("YSCSS=",VAR_3,6)==0) {

                

                VAR_3+=6;

                if (strncmp("420JPEG",VAR_3,7)==0)

                    VAR_14=PIX_FMT_YUV420P;

                else if (strncmp("420MPEG2",VAR_3,8)==0)

                    VAR_14=PIX_FMT_YUV420P;

                else if (strncmp("420PALDV",VAR_3,8)==0)

                    VAR_14=PIX_FMT_YUV420P;

                else if (strncmp("411",VAR_3,3)==0)

                    VAR_14=PIX_FMT_YUV411P;

                else if (strncmp("422",VAR_3,3)==0)

                    VAR_14=PIX_FMT_YUV422P;

                else if (strncmp("444",VAR_3,3)==0)

                    VAR_14=PIX_FMT_YUV444P;

            }

            while(VAR_3<VAR_5&&*VAR_3!=0x20) VAR_3++;

            break;

        }

    }



    if ((VAR_7 == -1) || (VAR_8 == -1)) {

        av_log(VAR_0, AV_LOG_ERROR, "YUV4MPEG has invalid VAR_2.\n");

        return -1;

    }



    if (VAR_13 == PIX_FMT_NONE) {

        if (VAR_14 == PIX_FMT_NONE)

            VAR_13 = PIX_FMT_YUV420P;

        else

            VAR_13 = VAR_14;

    }



    if (VAR_9 == 0 && VAR_10 == 0) {

         unknown

        VAR_9 = 25;

        VAR_10 = 1;

    }



    if (VAR_11 == 0 && VAR_12 == 0) {

         unknown

        VAR_12 = 1;

    }



    st = av_new_stream(VAR_0, 0);

    if(!st)

        return AVERROR(ENOMEM);

    st->codec->VAR_7 = VAR_7;

    st->codec->VAR_8 = VAR_8;

    av_reduce(&VAR_9, &VAR_10, VAR_9, VAR_10, (1UL<<31)-1);

    av_set_pts_info(st, 64, VAR_10, VAR_9);

    st->codec->VAR_13 = VAR_13;

    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;

    st->codec->codec_id = CODEC_ID_RAWVIDEO;

    st->sample_aspect_ratio= (AVRational){VAR_11, VAR_12};

    st->codec->VAR_15 = VAR_15;



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVFormatParameters *VAR_1)
{ char VAR_2[MAX_YUV4_HEADER+10]; char *VAR_3,*VAR_4,*VAR_5; int VAR_6; ByteIOContext *pb = VAR_0->pb; int VAR_7=-1, VAR_8=-1, VAR_9=0, VAR_10=0, VAR_11=0, VAR_12=0; enum PixelFormat VAR_13=PIX_FMT_NONE,VAR_14=PIX_FMT_NONE; enum AVChromaLocation VAR_15 = AVCHROMA_LOC_UNSPECIFIED; AVStream *st; struct frame_attributes *VAR_16 = VAR_0->priv_data; for (VAR_6=0; VAR_6<MAX_YUV4_HEADER; VAR_6++) { VAR_2[VAR_6] = get_byte(pb); if (VAR_2[VAR_6] == '\n') { VAR_2[VAR_6+1] = 0x20; VAR_2[VAR_6+2] = 0; break; } } if (VAR_6 == MAX_YUV4_HEADER) return -1; if (strncmp(VAR_2, Y4M_MAGIC, strlen(Y4M_MAGIC))) return -1; VAR_16->interlaced_frame = 0; VAR_16->top_field_first = 0; VAR_5 = &VAR_2[VAR_6+1]; for(VAR_3 = &VAR_2[strlen(Y4M_MAGIC) + 1]; VAR_3 < VAR_5; VAR_3++) { if (*VAR_3==0x20) continue; switch (*VAR_3++) { case 'W':
VAR_7 = strtol(VAR_3, &VAR_4, 10); VAR_3=VAR_4; break; case 'H':
VAR_8 = strtol(VAR_3, &VAR_4, 10); VAR_3=VAR_4; break; case 'C':
if (strncmp("420jpeg",VAR_3,7)==0) { VAR_13 = PIX_FMT_YUV420P; VAR_15 = AVCHROMA_LOC_CENTER; } else if (strncmp("420mpeg2",VAR_3,8)==0) { VAR_13 = PIX_FMT_YUV420P; VAR_15 = AVCHROMA_LOC_LEFT; } else if (strncmp("420paldv", VAR_3, 8)==0) { VAR_13 = PIX_FMT_YUV420P; VAR_15 = AVCHROMA_LOC_TOPLEFT; } else if (strncmp("411", VAR_3, 3)==0) VAR_13 = PIX_FMT_YUV411P; else if (strncmp("422", VAR_3, 3)==0)
VAR_13 = PIX_FMT_YUV422P; else if (strncmp("444alpha", VAR_3, 8)==0) { av_log(VAR_0, AV_LOG_ERROR, "Cannot handle 4:4:4:4 YUV4MPEG stream.\n"); return -1; } else if (strncmp("444", VAR_3, 3)==0) VAR_13 = PIX_FMT_YUV444P; else if (strncmp("mono",VAR_3, 4)==0) { VAR_13 = PIX_FMT_GRAY8; } else { av_log(VAR_0, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown pixel format.\n"); return -1; } while(VAR_3<VAR_5&&*VAR_3!=0x20) VAR_3++; break; case 'I':
switch (*VAR_3++){ case '?':
break; case 'p':
VAR_16->interlaced_frame=0; break; case 't':
VAR_16->interlaced_frame=1; VAR_16->top_field_first=1; break; case 'b':
VAR_16->interlaced_frame=1; VAR_16->top_field_first=0; break; case 'm':
av_log(VAR_0, AV_LOG_ERROR, "YUV4MPEG stream contains mixed interlaced and non-interlaced frames.\n"); return -1; default:
av_log(VAR_0, AV_LOG_ERROR, "YUV4MPEG has invalid VAR_2.\n"); return -1; } break; case 'F':
sscanf(VAR_3,"%d:%d",&VAR_9,&VAR_10); while(VAR_3<VAR_5&&*VAR_3!=0x20) VAR_3++; break; case 'A':
sscanf(VAR_3,"%d:%d",&VAR_11,&VAR_12); while(VAR_3<VAR_5&&*VAR_3!=0x20) VAR_3++; break; case 'X':
if (strncmp("YSCSS=",VAR_3,6)==0) { VAR_3+=6; if (strncmp("420JPEG",VAR_3,7)==0)
VAR_14=PIX_FMT_YUV420P; else if (strncmp("420MPEG2",VAR_3,8)==0)
VAR_14=PIX_FMT_YUV420P; else if (strncmp("420PALDV",VAR_3,8)==0)
VAR_14=PIX_FMT_YUV420P; else if (strncmp("411",VAR_3,3)==0)
VAR_14=PIX_FMT_YUV411P; else if (strncmp("422",VAR_3,3)==0)
VAR_14=PIX_FMT_YUV422P; else if (strncmp("444",VAR_3,3)==0)
VAR_14=PIX_FMT_YUV444P; } while(VAR_3<VAR_5&&*VAR_3!=0x20) VAR_3++; break; } } if ((VAR_7 == -1) || (VAR_8 == -1)) { av_log(VAR_0, AV_LOG_ERROR, "YUV4MPEG has invalid VAR_2.\n"); return -1; } if (VAR_13 == PIX_FMT_NONE) { if (VAR_14 == PIX_FMT_NONE)
VAR_13 = PIX_FMT_YUV420P; else
VAR_13 = VAR_14; } if (VAR_9 == 0 && VAR_10 == 0) { unknown
VAR_9 = 25; VAR_10 = 1; } if (VAR_11 == 0 && VAR_12 == 0) { unknown
VAR_12 = 1; } st = av_new_stream(VAR_0, 0); if(!st)
return AVERROR(ENOMEM); st->codec->VAR_7 = VAR_7; st->codec->VAR_8 = VAR_8; av_reduce(&VAR_9, &VAR_10, VAR_9, VAR_10, (1UL<<31)-1); av_set_pts_info(st, 64, VAR_10, VAR_9); st->codec->VAR_13 = VAR_13; st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_RAWVIDEO; st->sample_aspect_ratio= (AVRational){VAR_11, VAR_12}; st->codec->VAR_15 = VAR_15; return 0; }