Esempio n. 1
0
int main(int argc, char *argv[])
{
    AVIOContext *in = NULL;
    VOBU *vobus = NULL;
    int ret, i = 0, nb_vobus;
    av_register_all();

    if (argc < 2)
        help(argv[0]);

    ret = avio_open(&in, argv[1], AVIO_FLAG_READ);

    if (ret < 0) {
        char errbuf[128];
        av_strerror(ret, errbuf, sizeof(errbuf));
        av_log(NULL, AV_LOG_ERROR, "Cannot open %s: %s",
               argv[1], errbuf);
        return 1;
    }

    nb_vobus = populate_vobs(&vobus, argv[1]);

    for (i = 0; i < nb_vobus; i++) {
        write_vob(vobus + i, in);
    }

    av_free(vobus);

    avio_close(in);

    return 0;
}
Esempio n. 2
0
static int fix_vob(cell_adr_t *cell_adr_table,
                   const char *src_path,
                   const char *dst_path)
{
    VOBU *vobus;
    int nb_vobus;
    CELL *cells;
    int nb_cells, i;

    if ((nb_vobus = populate_vobs(&vobus, src_path)) < 0)
        return -1;

    if ((nb_cells = populate_cells(&cells, vobus, nb_vobus)) < 0)
        return -1;

    for (i = 0; i < nb_cells; i++) {
         av_log(NULL, AV_LOG_INFO|AV_LOG_C(128),
                "vob_id %02d, cell_id %02d, off 0x%08x",
                cell_adr_table[i].vob_id,
                cell_adr_table[i].cell_id,
                cell_adr_table[i].start_sector);

        av_log(NULL, AV_LOG_INFO, " -> ");

        av_log(NULL, AV_LOG_INFO|AV_LOG_C(111),
                "vob_id %02d, cell_id %02d, off 0x%08x",
                cells[i].vob_id,
                cells[i].cell_id,
                cells[i].start_sector);
        if (cell_adr_table[i].vob_id != cells[i].vob_id ||
            cell_adr_table[i].cell_id != cells[i].cell_id)
            av_log(NULL, AV_LOG_INFO|AV_LOG_C(222),
                   " X ");
        av_log(NULL, AV_LOG_INFO, "\n");
    }

    return 0;
}