Revision 9bcb92ca libavformat/matroskadec.c

View differences:

libavformat/matroskadec.c
846 846
    return 0;
847 847
}
848 848

  
849
static int ebml_parse(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
849
static int ebml_parse_nest(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
850 850
                      void *data, int once);
851 851

  
852 852
static int ebml_parse_elem(MatroskaDemuxContext *matroska,
......
881 881
                         return res;
882 882
                     if (id == MATROSKA_ID_SEGMENT)
883 883
                         matroska->segment_start = url_ftell(matroska->ctx->pb);
884
                     return ebml_parse(matroska, syntax->def.n, data, 0);
885
    case EBML_PASS:  return ebml_parse(matroska, syntax->def.n, data, 1);
884
                     return ebml_parse_nest(matroska, syntax->def.n, data, 0);
885
    case EBML_PASS:  return ebml_parse_nest(matroska, syntax->def.n, data, 1);
886 886
    case EBML_STOP:  *(int *)data = 1;      return 1;
887 887
    default:         url_fskip(pb, length); return 0;
888 888
    }
......
905 905
    return ebml_parse_elem(matroska, &syntax[i], data);
906 906
}
907 907

  
908
static int ebml_parse(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
908
static int ebml_parse_nest(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
909 909
                      void *data, int once)
910 910
{
911 911
    int i, res = 0;
......
1125 1125
    matroska->ctx = s;
1126 1126

  
1127 1127
    /* First read the EBML header. */
1128
    if (ebml_parse(matroska, ebml_syntax, &ebml, 1)
1128
    if (ebml_parse_nest(matroska, ebml_syntax, &ebml, 1)
1129 1129
        || ebml.version > EBML_VERSION       || ebml.max_size > sizeof(uint64_t)
1130 1130
        || ebml.id_length > sizeof(uint32_t) || strcmp(ebml.doctype, "matroska")
1131 1131
        || ebml.doctype_version > 2) {
......
1138 1138
    ebml_free(ebml_syntax, &ebml);
1139 1139

  
1140 1140
    /* The next thing is a segment. */
1141
    if (ebml_parse(matroska, matroska_segments, matroska, 1) < 0)
1141
    if (ebml_parse_nest(matroska, matroska_segments, matroska, 1) < 0)
1142 1142
        return -1;
1143 1143
    matroska_execute_seekhead(matroska);
1144 1144

  
......
1628 1628
    MatroskaCluster cluster = { 0 };
1629 1629
    EbmlList *blocks_list;
1630 1630
    MatroskaBlock *blocks;
1631
    int i, res = ebml_parse(matroska, matroska_clusters, &cluster, 1);
1631
    int i, res = ebml_parse_nest(matroska, matroska_clusters, &cluster, 1);
1632 1632
    blocks_list = &cluster.blocks;
1633 1633
    blocks = blocks_list->elem;
1634 1634
    for (i=0; !res && i<blocks_list->nb_elem; i++)

Also available in: Unified diff