OLD | NEW |
1 /* | 1 /* |
2 * Matroska file demuxer | 2 * Matroska file demuxer |
3 * Copyright (c) 2003-2008 The FFmpeg Project | 3 * Copyright (c) 2003-2008 The FFmpeg Project |
4 * | 4 * |
5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
6 * | 6 * |
7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 avio_seek(matroska->ctx->pb, before_pos, SEEK_SET); | 1234 avio_seek(matroska->ctx->pb, before_pos, SEEK_SET); |
1235 matroska->level_up = level_up; | 1235 matroska->level_up = level_up; |
1236 matroska->current_id = saved_id; | 1236 matroska->current_id = saved_id; |
1237 | 1237 |
1238 return ret; | 1238 return ret; |
1239 } | 1239 } |
1240 | 1240 |
1241 static void matroska_execute_seekhead(MatroskaDemuxContext *matroska) | 1241 static void matroska_execute_seekhead(MatroskaDemuxContext *matroska) |
1242 { | 1242 { |
1243 EbmlList *seekhead_list = &matroska->seekhead; | 1243 EbmlList *seekhead_list = &matroska->seekhead; |
1244 MatroskaSeekhead *seekhead = seekhead_list->elem; | |
1245 int64_t before_pos = avio_tell(matroska->ctx->pb); | 1244 int64_t before_pos = avio_tell(matroska->ctx->pb); |
1246 int i; | 1245 int i; |
1247 | 1246 |
1248 // we should not do any seeking in the streaming case | 1247 // we should not do any seeking in the streaming case |
1249 if (!matroska->ctx->pb->seekable || | 1248 if (!matroska->ctx->pb->seekable || |
1250 (matroska->ctx->flags & AVFMT_FLAG_IGNIDX)) | 1249 (matroska->ctx->flags & AVFMT_FLAG_IGNIDX)) |
1251 return; | 1250 return; |
1252 | 1251 |
1253 for (i = 0; i < seekhead_list->nb_elem; i++) { | 1252 for (i = 0; i < seekhead_list->nb_elem; i++) { |
| 1253 MatroskaSeekhead *seekhead = seekhead_list->elem; |
1254 if (seekhead[i].pos <= before_pos) | 1254 if (seekhead[i].pos <= before_pos) |
1255 continue; | 1255 continue; |
1256 | 1256 |
1257 // defer cues parsing until we actually need cue data. | 1257 // defer cues parsing until we actually need cue data. |
1258 if (seekhead[i].id == MATROSKA_ID_CUES) { | 1258 if (seekhead[i].id == MATROSKA_ID_CUES) { |
1259 matroska->cues_parsing_deferred = 1; | 1259 matroska->cues_parsing_deferred = 1; |
1260 continue; | 1260 continue; |
1261 } | 1261 } |
1262 | 1262 |
1263 if (matroska_parse_seekhead_entry(matroska, i) < 0) | 1263 if (matroska_parse_seekhead_entry(matroska, i) < 0) |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2174 AVInputFormat ff_matroska_demuxer = { | 2174 AVInputFormat ff_matroska_demuxer = { |
2175 "matroska,webm", | 2175 "matroska,webm", |
2176 NULL_IF_CONFIG_SMALL("Matroska/WebM file format"), | 2176 NULL_IF_CONFIG_SMALL("Matroska/WebM file format"), |
2177 sizeof(MatroskaDemuxContext), | 2177 sizeof(MatroskaDemuxContext), |
2178 matroska_probe, | 2178 matroska_probe, |
2179 matroska_read_header, | 2179 matroska_read_header, |
2180 matroska_read_packet, | 2180 matroska_read_packet, |
2181 matroska_read_close, | 2181 matroska_read_close, |
2182 matroska_read_seek, | 2182 matroska_read_seek, |
2183 }; | 2183 }; |
OLD | NEW |