static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int file)

{

    MlvContext *mlv = avctx->priv_data;

    AVIOContext *pb = mlv->pb[file];

    int ret;

    while (!avio_feof(pb)) {

        int type;

        unsigned int size;

        type = avio_rl32(pb);

        size = avio_rl32(pb);

        avio_skip(pb, 8); //timestamp

        if (size < 16)

            break;

        size -= 16;

        if (vst && type == MKTAG('R','A','W','I') && size >= 164) {

            vst->codec->width  = avio_rl16(pb);

            vst->codec->height = avio_rl16(pb);

            if (avio_rl32(pb) != 1)

                avpriv_request_sample(avctx, "raw api version");

            avio_skip(pb, 20); // pointer, width, height, pitch, frame_size

            vst->codec->bits_per_coded_sample = avio_rl32(pb);

            avio_skip(pb, 8 + 16 + 24); // black_level, white_level, xywh, active_area, exposure_bias

            if (avio_rl32(pb) != 0x2010100) /* RGGB */

                avpriv_request_sample(avctx, "cfa_pattern");

            avio_skip(pb, 80); // calibration_illuminant1, color_matrix1, dynamic_range

            vst->codec->pix_fmt  = AV_PIX_FMT_BAYER_RGGB16LE;

            vst->codec->codec_tag = MKTAG('B', 'I', 'T', 16);

            size -= 164;

        } else if (ast && type == MKTAG('W', 'A', 'V', 'I') && size >= 16) {

            ret = ff_get_wav_header(pb, ast->codec, 16);

            if (ret < 0)

                return ret;

            size -= 16;

        } else if (type == MKTAG('I','N','F','O')) {

            if (size > 0)

                read_string(avctx, pb, "info", size);

            continue;

        } else if (type == MKTAG('I','D','N','T') && size >= 36) {

            read_string(avctx, pb, "cameraName", 32);

            read_uint32(avctx, pb, "cameraModel", "0x%"PRIx32);

            size -= 36;

            if (size >= 32) {

                read_string(avctx, pb, "cameraSerial", 32);

                size -= 32;

            }

        } else if (type == MKTAG('L','E','N','S') && size >= 48) {

            read_uint16(avctx, pb, "focalLength", "%i");

            read_uint16(avctx, pb, "focalDist", "%i");

            read_uint16(avctx, pb, "aperture", "%i");

            read_uint8(avctx, pb, "stabilizerMode", "%i");

            read_uint8(avctx, pb, "autofocusMode", "%i");

            read_uint32(avctx, pb, "flags", "0x%"PRIx32);

            read_uint32(avctx, pb, "lensID", "%"PRIi32);

            read_string(avctx, pb, "lensName", 32);

            size -= 48;

            if (size >= 32) {

                read_string(avctx, pb, "lensSerial", 32);

                size -= 32;

            }

        } else if (vst && type == MKTAG('V', 'I', 'D', 'F') && size >= 4) {

            uint64_t pts = avio_rl32(pb);

            ff_add_index_entry(&vst->index_entries, &vst->nb_index_entries, &vst->index_entries_allocated_size,

                               avio_tell(pb) - 20, pts, file, 0, AVINDEX_KEYFRAME);

            size -= 4;

        } else if (ast && type == MKTAG('A', 'U', 'D', 'F') && size >= 4) {

            uint64_t pts = avio_rl32(pb);

            ff_add_index_entry(&ast->index_entries, &ast->nb_index_entries, &ast->index_entries_allocated_size,

                               avio_tell(pb) - 20, pts, file, 0, AVINDEX_KEYFRAME);

            size -= 4;

        } else if (vst && type == MKTAG('W','B','A','L') && size >= 28) {

            read_uint32(avctx, pb, "wb_mode", "%"PRIi32);

            read_uint32(avctx, pb, "kelvin", "%"PRIi32);

            read_uint32(avctx, pb, "wbgain_r", "%"PRIi32);

            read_uint32(avctx, pb, "wbgain_g", "%"PRIi32);

            read_uint32(avctx, pb, "wbgain_b", "%"PRIi32);

            read_uint32(avctx, pb, "wbs_gm", "%"PRIi32);

            read_uint32(avctx, pb, "wbs_ba", "%"PRIi32);

            size -= 28;

        } else if (type == MKTAG('R','T','C','I') && size >= 20) {

            char str[32];

            struct tm time = { 0 };

            time.tm_sec    = avio_rl16(pb);

            time.tm_min    = avio_rl16(pb);

            time.tm_hour   = avio_rl16(pb);

            time.tm_mday   = avio_rl16(pb);

            time.tm_mon    = avio_rl16(pb);

            time.tm_year   = avio_rl16(pb);

            time.tm_wday   = avio_rl16(pb);

            time.tm_yday   = avio_rl16(pb);

            time.tm_isdst  = avio_rl16(pb);

            avio_skip(pb, 2);

            strftime(str, sizeof(str), "%Y-%m-%d %H:%M:%S", &time);

            av_dict_set(&avctx->metadata, "time", str, 0);

            size -= 20;

        } else if (type == MKTAG('E','X','P','O') && size >= 16) {

            av_dict_set(&avctx->metadata, "isoMode", avio_rl32(pb) ? "auto" : "manual", 0);

            read_uint32(avctx, pb, "isoValue", "%"PRIi32);

            read_uint32(avctx, pb, "isoAnalog", "%"PRIi32);

            read_uint32(avctx, pb, "digitalGain", "%"PRIi32);

            size -= 16;

            if (size >= 8) {

                read_uint64(avctx, pb, "shutterValue", "%"PRIi64);

                size -= 8;

            }

        } else if (type == MKTAG('S','T','Y','L') && size >= 36) {

            read_uint32(avctx, pb, "picStyleId", "%"PRIi32);

            read_uint32(avctx, pb, "contrast", "%"PRIi32);

            read_uint32(avctx, pb, "sharpness", "%"PRIi32);

            read_uint32(avctx, pb, "saturation", "%"PRIi32);

            read_uint32(avctx, pb, "colortone", "%"PRIi32);

            read_string(avctx, pb, "picStyleName", 16);

            size -= 36;

        } else if (type == MKTAG('M','A','R','K')) {

        } else if (type == MKTAG('N','U','L','L')) {

        } else if (type == MKTAG('M','L','V','I')) { /* occurs when MLV and Mnn files are concatenated */

        } else {

            av_log(avctx, AV_LOG_INFO, "unsupported tag %c%c%c%c, size %u\n", type&0xFF, (type>>8)&0xFF, (type>>16)&0xFF, (type>>24)&0xFF, size);

        }

        avio_skip(pb, size);

    }

    return 0;

}

static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int file)

{

    MlvContext *mlv = avctx->priv_data;

    AVIOContext *pb = mlv->pb[file];

    int ret;

    while (!avio_feof(pb)) {

        int type;

        unsigned int size;

        type = avio_rl32(pb);

        size = avio_rl32(pb);

        avio_skip(pb, 8); 

        if (size < 16)

            break;

        size -= 16;

        if (vst && type == MKTAG('R','A','W','I') && size >= 164) {

            vst->codec->width  = avio_rl16(pb);

            vst->codec->height = avio_rl16(pb);

            if (avio_rl32(pb) != 1)

                avpriv_request_sample(avctx, "raw api version");

            avio_skip(pb, 20); 

            vst->codec->bits_per_coded_sample = avio_rl32(pb);

            avio_skip(pb, 8 + 16 + 24); 

            if (avio_rl32(pb) != 0x2010100) 

                avpriv_request_sample(avctx, "cfa_pattern");

            avio_skip(pb, 80); 

            vst->codec->pix_fmt  = AV_PIX_FMT_BAYER_RGGB16LE;

            vst->codec->codec_tag = MKTAG('B', 'I', 'T', 16);

            size -= 164;

        } else if (ast && type == MKTAG('W', 'A', 'V', 'I') && size >= 16) {

            ret = ff_get_wav_header(pb, ast->codec, 16);

            if (ret < 0)

                return ret;

            size -= 16;

        } else if (type == MKTAG('I','N','F','O')) {

            if (size > 0)

                read_string(avctx, pb, "info", size);

            continue;

        } else if (type == MKTAG('I','D','N','T') && size >= 36) {

            read_string(avctx, pb, "cameraName", 32);

            read_uint32(avctx, pb, "cameraModel", "0x%"PRIx32);

            size -= 36;

            if (size >= 32) {

                read_string(avctx, pb, "cameraSerial", 32);

                size -= 32;

            }

        } else if (type == MKTAG('L','E','N','S') && size >= 48) {

            read_uint16(avctx, pb, "focalLength", "%i");

            read_uint16(avctx, pb, "focalDist", "%i");

            read_uint16(avctx, pb, "aperture", "%i");

            read_uint8(avctx, pb, "stabilizerMode", "%i");

            read_uint8(avctx, pb, "autofocusMode", "%i");

            read_uint32(avctx, pb, "flags", "0x%"PRIx32);

            read_uint32(avctx, pb, "lensID", "%"PRIi32);

            read_string(avctx, pb, "lensName", 32);

            size -= 48;

            if (size >= 32) {

                read_string(avctx, pb, "lensSerial", 32);

                size -= 32;

            }

        } else if (vst && type == MKTAG('V', 'I', 'D', 'F') && size >= 4) {

            uint64_t pts = avio_rl32(pb);

            ff_add_index_entry(&vst->index_entries, &vst->nb_index_entries, &vst->index_entries_allocated_size,

                               avio_tell(pb) - 20, pts, file, 0, AVINDEX_KEYFRAME);

            size -= 4;

        } else if (ast && type == MKTAG('A', 'U', 'D', 'F') && size >= 4) {

            uint64_t pts = avio_rl32(pb);

            ff_add_index_entry(&ast->index_entries, &ast->nb_index_entries, &ast->index_entries_allocated_size,

                               avio_tell(pb) - 20, pts, file, 0, AVINDEX_KEYFRAME);

            size -= 4;

        } else if (vst && type == MKTAG('W','B','A','L') && size >= 28) {

            read_uint32(avctx, pb, "wb_mode", "%"PRIi32);

            read_uint32(avctx, pb, "kelvin", "%"PRIi32);

            read_uint32(avctx, pb, "wbgain_r", "%"PRIi32);

            read_uint32(avctx, pb, "wbgain_g", "%"PRIi32);

            read_uint32(avctx, pb, "wbgain_b", "%"PRIi32);

            read_uint32(avctx, pb, "wbs_gm", "%"PRIi32);

            read_uint32(avctx, pb, "wbs_ba", "%"PRIi32);

            size -= 28;

        } else if (type == MKTAG('R','T','C','I') && size >= 20) {

            char str[32];

            struct tm time = { 0 };

            time.tm_sec    = avio_rl16(pb);

            time.tm_min    = avio_rl16(pb);

            time.tm_hour   = avio_rl16(pb);

            time.tm_mday   = avio_rl16(pb);

            time.tm_mon    = avio_rl16(pb);

            time.tm_year   = avio_rl16(pb);

            time.tm_wday   = avio_rl16(pb);

            time.tm_yday   = avio_rl16(pb);

            time.tm_isdst  = avio_rl16(pb);

            avio_skip(pb, 2);

            strftime(str, sizeof(str), "%Y-%m-%d %H:%M:%S", &time);

            av_dict_set(&avctx->metadata, "time", str, 0);

            size -= 20;

        } else if (type == MKTAG('E','X','P','O') && size >= 16) {

            av_dict_set(&avctx->metadata, "isoMode", avio_rl32(pb) ? "auto" : "manual", 0);

            read_uint32(avctx, pb, "isoValue", "%"PRIi32);

            read_uint32(avctx, pb, "isoAnalog", "%"PRIi32);

            read_uint32(avctx, pb, "digitalGain", "%"PRIi32);

            size -= 16;

            if (size >= 8) {

                read_uint64(avctx, pb, "shutterValue", "%"PRIi64);

                size -= 8;

            }

        } else if (type == MKTAG('S','T','Y','L') && size >= 36) {

            read_uint32(avctx, pb, "picStyleId", "%"PRIi32);

            read_uint32(avctx, pb, "contrast", "%"PRIi32);

            read_uint32(avctx, pb, "sharpness", "%"PRIi32);

            read_uint32(avctx, pb, "saturation", "%"PRIi32);

            read_uint32(avctx, pb, "colortone", "%"PRIi32);

            read_string(avctx, pb, "picStyleName", 16);

            size -= 36;

        } else if (type == MKTAG('M','A','R','K')) {

        } else if (type == MKTAG('N','U','L','L')) {

        } else if (type == MKTAG('M','L','V','I')) { 

        } else {

            av_log(avctx, AV_LOG_INFO, "unsupported tag %c%c%c%c, size %u\n", type&0xFF, (type>>8)&0xFF, (type>>16)&0xFF, (type>>24)&0xFF, size);

        }

        avio_skip(pb, size);

    }

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVStream *VAR_1, AVStream *VAR_2, int VAR_3)

{

    MlvContext *mlv = VAR_0->priv_data;

    AVIOContext *pb = mlv->pb[VAR_3];

    int VAR_4;

    while (!avio_feof(pb)) {

        int VAR_5;

        unsigned int VAR_6;

        VAR_5 = avio_rl32(pb);

        VAR_6 = avio_rl32(pb);

        avio_skip(pb, 8); 

        if (VAR_6 < 16)

            break;

        VAR_6 -= 16;

        if (VAR_1 && VAR_5 == MKTAG('R','A','W','I') && VAR_6 >= 164) {

            VAR_1->codec->width  = avio_rl16(pb);

            VAR_1->codec->height = avio_rl16(pb);

            if (avio_rl32(pb) != 1)

                avpriv_request_sample(VAR_0, "raw api version");

            avio_skip(pb, 20); 

            VAR_1->codec->bits_per_coded_sample = avio_rl32(pb);

            avio_skip(pb, 8 + 16 + 24); 

            if (avio_rl32(pb) != 0x2010100) 

                avpriv_request_sample(VAR_0, "cfa_pattern");

            avio_skip(pb, 80); 

            VAR_1->codec->pix_fmt  = AV_PIX_FMT_BAYER_RGGB16LE;

            VAR_1->codec->codec_tag = MKTAG('B', 'I', 'T', 16);

            VAR_6 -= 164;

        } else if (VAR_2 && VAR_5 == MKTAG('W', 'A', 'V', 'I') && VAR_6 >= 16) {

            VAR_4 = ff_get_wav_header(pb, VAR_2->codec, 16);

            if (VAR_4 < 0)

                return VAR_4;

            VAR_6 -= 16;

        } else if (VAR_5 == MKTAG('I','N','F','O')) {

            if (VAR_6 > 0)

                read_string(VAR_0, pb, "info", VAR_6);

            continue;

        } else if (VAR_5 == MKTAG('I','D','N','T') && VAR_6 >= 36) {

            read_string(VAR_0, pb, "cameraName", 32);

            read_uint32(VAR_0, pb, "cameraModel", "0x%"PRIx32);

            VAR_6 -= 36;

            if (VAR_6 >= 32) {

                read_string(VAR_0, pb, "cameraSerial", 32);

                VAR_6 -= 32;

            }

        } else if (VAR_5 == MKTAG('L','E','N','S') && VAR_6 >= 48) {

            read_uint16(VAR_0, pb, "focalLength", "%i");

            read_uint16(VAR_0, pb, "focalDist", "%i");

            read_uint16(VAR_0, pb, "aperture", "%i");

            read_uint8(VAR_0, pb, "stabilizerMode", "%i");

            read_uint8(VAR_0, pb, "autofocusMode", "%i");

            read_uint32(VAR_0, pb, "flags", "0x%"PRIx32);

            read_uint32(VAR_0, pb, "lensID", "%"PRIi32);

            read_string(VAR_0, pb, "lensName", 32);

            VAR_6 -= 48;

            if (VAR_6 >= 32) {

                read_string(VAR_0, pb, "lensSerial", 32);

                VAR_6 -= 32;

            }

        } else if (VAR_1 && VAR_5 == MKTAG('V', 'I', 'D', 'F') && VAR_6 >= 4) {

            uint64_t pts = avio_rl32(pb);

            ff_add_index_entry(&VAR_1->index_entries, &VAR_1->nb_index_entries, &VAR_1->index_entries_allocated_size,

                               avio_tell(pb) - 20, pts, VAR_3, 0, AVINDEX_KEYFRAME);

            VAR_6 -= 4;

        } else if (VAR_2 && VAR_5 == MKTAG('A', 'U', 'D', 'F') && VAR_6 >= 4) {

            uint64_t pts = avio_rl32(pb);

            ff_add_index_entry(&VAR_2->index_entries, &VAR_2->nb_index_entries, &VAR_2->index_entries_allocated_size,

                               avio_tell(pb) - 20, pts, VAR_3, 0, AVINDEX_KEYFRAME);

            VAR_6 -= 4;

        } else if (VAR_1 && VAR_5 == MKTAG('W','B','A','L') && VAR_6 >= 28) {

            read_uint32(VAR_0, pb, "wb_mode", "%"PRIi32);

            read_uint32(VAR_0, pb, "kelvin", "%"PRIi32);

            read_uint32(VAR_0, pb, "wbgain_r", "%"PRIi32);

            read_uint32(VAR_0, pb, "wbgain_g", "%"PRIi32);

            read_uint32(VAR_0, pb, "wbgain_b", "%"PRIi32);

            read_uint32(VAR_0, pb, "wbs_gm", "%"PRIi32);

            read_uint32(VAR_0, pb, "wbs_ba", "%"PRIi32);

            VAR_6 -= 28;

        } else if (VAR_5 == MKTAG('R','T','C','I') && VAR_6 >= 20) {

            char VAR_7[32];

            struct tm VAR_8 = { 0 };

            VAR_8.tm_sec    = avio_rl16(pb);

            VAR_8.tm_min    = avio_rl16(pb);

            VAR_8.tm_hour   = avio_rl16(pb);

            VAR_8.tm_mday   = avio_rl16(pb);

            VAR_8.tm_mon    = avio_rl16(pb);

            VAR_8.tm_year   = avio_rl16(pb);

            VAR_8.tm_wday   = avio_rl16(pb);

            VAR_8.tm_yday   = avio_rl16(pb);

            VAR_8.tm_isdst  = avio_rl16(pb);

            avio_skip(pb, 2);

            strftime(VAR_7, sizeof(VAR_7), "%Y-%m-%d %H:%M:%S", &VAR_8);

            av_dict_set(&VAR_0->metadata, "VAR_8", VAR_7, 0);

            VAR_6 -= 20;

        } else if (VAR_5 == MKTAG('E','X','P','O') && VAR_6 >= 16) {

            av_dict_set(&VAR_0->metadata, "isoMode", avio_rl32(pb) ? "auto" : "manual", 0);

            read_uint32(VAR_0, pb, "isoValue", "%"PRIi32);

            read_uint32(VAR_0, pb, "isoAnalog", "%"PRIi32);

            read_uint32(VAR_0, pb, "digitalGain", "%"PRIi32);

            VAR_6 -= 16;

            if (VAR_6 >= 8) {

                read_uint64(VAR_0, pb, "shutterValue", "%"PRIi64);

                VAR_6 -= 8;

            }

        } else if (VAR_5 == MKTAG('S','T','Y','L') && VAR_6 >= 36) {

            read_uint32(VAR_0, pb, "picStyleId", "%"PRIi32);

            read_uint32(VAR_0, pb, "contrast", "%"PRIi32);

            read_uint32(VAR_0, pb, "sharpness", "%"PRIi32);

            read_uint32(VAR_0, pb, "saturation", "%"PRIi32);

            read_uint32(VAR_0, pb, "colortone", "%"PRIi32);

            read_string(VAR_0, pb, "picStyleName", 16);

            VAR_6 -= 36;

        } else if (VAR_5 == MKTAG('M','A','R','K')) {

        } else if (VAR_5 == MKTAG('N','U','L','L')) {

        } else if (VAR_5 == MKTAG('M','L','V','I')) { 

        } else {

            av_log(VAR_0, AV_LOG_INFO, "unsupported tag %c%c%c%c, VAR_6 %u\n", VAR_5&0xFF, (VAR_5>>8)&0xFF, (VAR_5>>16)&0xFF, (VAR_5>>24)&0xFF, VAR_6);

        }

        avio_skip(pb, VAR_6);

    }

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVStream *VAR_1, AVStream *VAR_2, int VAR_3)
{ MlvContext *mlv = VAR_0->priv_data; AVIOContext *pb = mlv->pb[VAR_3]; int VAR_4; while (!avio_feof(pb)) { int VAR_5; unsigned int VAR_6; VAR_5 = avio_rl32(pb); VAR_6 = avio_rl32(pb); avio_skip(pb, 8); if (VAR_6 < 16)
break; VAR_6 -= 16; if (VAR_1 && VAR_5 == MKTAG('R','A','W','I') && VAR_6 >= 164) { VAR_1->codec->width  = avio_rl16(pb); VAR_1->codec->height = avio_rl16(pb); if (avio_rl32(pb) != 1)
avpriv_request_sample(VAR_0, "raw api version"); avio_skip(pb, 20); VAR_1->codec->bits_per_coded_sample = avio_rl32(pb); avio_skip(pb, 8 + 16 + 24); if (avio_rl32(pb) != 0x2010100)
avpriv_request_sample(VAR_0, "cfa_pattern"); avio_skip(pb, 80); VAR_1->codec->pix_fmt  = AV_PIX_FMT_BAYER_RGGB16LE; VAR_1->codec->codec_tag = MKTAG('B', 'I', 'T', 16); VAR_6 -= 164; } else if (VAR_2 && VAR_5 == MKTAG('W', 'A', 'V', 'I') && VAR_6 >= 16) { VAR_4 = ff_get_wav_header(pb, VAR_2->codec, 16); if (VAR_4 < 0)
return VAR_4; VAR_6 -= 16; } else if (VAR_5 == MKTAG('I','N','F','O')) { if (VAR_6 > 0)
read_string(VAR_0, pb, "info", VAR_6); continue; } else if (VAR_5 == MKTAG('I','D','N','T') && VAR_6 >= 36) { read_string(VAR_0, pb, "cameraName", 32); read_uint32(VAR_0, pb, "cameraModel", "0x%"PRIx32); VAR_6 -= 36; if (VAR_6 >= 32) { read_string(VAR_0, pb, "cameraSerial", 32); VAR_6 -= 32; } } else if (VAR_5 == MKTAG('L','E','N','S') && VAR_6 >= 48) { read_uint16(VAR_0, pb, "focalLength", "%i"); read_uint16(VAR_0, pb, "focalDist", "%i"); read_uint16(VAR_0, pb, "aperture", "%i"); read_uint8(VAR_0, pb, "stabilizerMode", "%i"); read_uint8(VAR_0, pb, "autofocusMode", "%i"); read_uint32(VAR_0, pb, "flags", "0x%"PRIx32); read_uint32(VAR_0, pb, "lensID", "%"PRIi32); read_string(VAR_0, pb, "lensName", 32); VAR_6 -= 48; if (VAR_6 >= 32) { read_string(VAR_0, pb, "lensSerial", 32); VAR_6 -= 32; } } else if (VAR_1 && VAR_5 == MKTAG('V', 'I', 'D', 'F') && VAR_6 >= 4) { uint64_t pts = avio_rl32(pb); ff_add_index_entry(&VAR_1->index_entries, &VAR_1->nb_index_entries, &VAR_1->index_entries_allocated_size,
avio_tell(pb) - 20, pts, VAR_3, 0, AVINDEX_KEYFRAME); VAR_6 -= 4; } else if (VAR_2 && VAR_5 == MKTAG('A', 'U', 'D', 'F') && VAR_6 >= 4) { uint64_t pts = avio_rl32(pb); ff_add_index_entry(&VAR_2->index_entries, &VAR_2->nb_index_entries, &VAR_2->index_entries_allocated_size,
avio_tell(pb) - 20, pts, VAR_3, 0, AVINDEX_KEYFRAME); VAR_6 -= 4; } else if (VAR_1 && VAR_5 == MKTAG('W','B','A','L') && VAR_6 >= 28) { read_uint32(VAR_0, pb, "wb_mode", "%"PRIi32); read_uint32(VAR_0, pb, "kelvin", "%"PRIi32); read_uint32(VAR_0, pb, "wbgain_r", "%"PRIi32); read_uint32(VAR_0, pb, "wbgain_g", "%"PRIi32); read_uint32(VAR_0, pb, "wbgain_b", "%"PRIi32); read_uint32(VAR_0, pb, "wbs_gm", "%"PRIi32); read_uint32(VAR_0, pb, "wbs_ba", "%"PRIi32); VAR_6 -= 28; } else if (VAR_5 == MKTAG('R','T','C','I') && VAR_6 >= 20) { char VAR_7[32]; struct tm VAR_8 = { 0 }; VAR_8.tm_sec    = avio_rl16(pb); VAR_8.tm_min    = avio_rl16(pb); VAR_8.tm_hour   = avio_rl16(pb); VAR_8.tm_mday   = avio_rl16(pb); VAR_8.tm_mon    = avio_rl16(pb); VAR_8.tm_year   = avio_rl16(pb); VAR_8.tm_wday   = avio_rl16(pb); VAR_8.tm_yday   = avio_rl16(pb); VAR_8.tm_isdst  = avio_rl16(pb); avio_skip(pb, 2); strftime(VAR_7, sizeof(VAR_7), "%Y-%m-%d %H:%M:%S", &VAR_8); av_dict_set(&VAR_0->metadata, "VAR_8", VAR_7, 0); VAR_6 -= 20; } else if (VAR_5 == MKTAG('E','X','P','O') && VAR_6 >= 16) { av_dict_set(&VAR_0->metadata, "isoMode", avio_rl32(pb) ? "auto" : "manual", 0); read_uint32(VAR_0, pb, "isoValue", "%"PRIi32); read_uint32(VAR_0, pb, "isoAnalog", "%"PRIi32); read_uint32(VAR_0, pb, "digitalGain", "%"PRIi32); VAR_6 -= 16; if (VAR_6 >= 8) { read_uint64(VAR_0, pb, "shutterValue", "%"PRIi64); VAR_6 -= 8; } } else if (VAR_5 == MKTAG('S','T','Y','L') && VAR_6 >= 36) { read_uint32(VAR_0, pb, "picStyleId", "%"PRIi32); read_uint32(VAR_0, pb, "contrast", "%"PRIi32); read_uint32(VAR_0, pb, "sharpness", "%"PRIi32); read_uint32(VAR_0, pb, "saturation", "%"PRIi32); read_uint32(VAR_0, pb, "colortone", "%"PRIi32); read_string(VAR_0, pb, "picStyleName", 16); VAR_6 -= 36; } else if (VAR_5 == MKTAG('M','A','R','K')) { } else if (VAR_5 == MKTAG('N','U','L','L')) { } else if (VAR_5 == MKTAG('M','L','V','I')) { } else { av_log(VAR_0, AV_LOG_INFO, "unsupported tag %c%c%c%c, VAR_6 %u\n", VAR_5&0xFF, (VAR_5>>8)&0xFF, (VAR_5>>16)&0xFF, (VAR_5>>24)&0xFF, VAR_6); } avio_skip(pb, VAR_6); } return 0; }