Commit 66cfc385 authored by Aurelien Jacobs's avatar Aurelien Jacobs

matroskadec: remove now useless wrapper ebml_read_seek()

Originally committed as revision 14602 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 5c5373ce
...@@ -550,17 +550,6 @@ static int ebml_read_element_length(MatroskaDemuxContext *matroska, ...@@ -550,17 +550,6 @@ static int ebml_read_element_length(MatroskaDemuxContext *matroska,
return ebml_read_num(matroska, 8, length); return ebml_read_num(matroska, 8, length);
} }
/*
* Seek to a given offset.
* 0 is success, -1 is failure.
*/
static int ebml_read_seek(MatroskaDemuxContext *matroska, offset_t offset)
{
ByteIOContext *pb = matroska->ctx->pb;
return (url_fseek(pb, offset, SEEK_SET) == offset) ? 0 : -1;
}
/* /*
* Read the next element as an unsigned int. * Read the next element as an unsigned int.
* 0 is success, < 0 is failure. * 0 is success, < 0 is failure.
...@@ -1034,14 +1023,15 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska) ...@@ -1034,14 +1023,15 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)
int i; int i;
for (i=0; i<seekhead_list->nb_elem; i++) { for (i=0; i<seekhead_list->nb_elem; i++) {
offset_t offset = seekhead[i].pos + matroska->segment_start;
if (seekhead[i].pos <= before_pos if (seekhead[i].pos <= before_pos
|| seekhead[i].id == MATROSKA_ID_SEEKHEAD || seekhead[i].id == MATROSKA_ID_SEEKHEAD
|| seekhead[i].id == MATROSKA_ID_CLUSTER) || seekhead[i].id == MATROSKA_ID_CLUSTER)
continue; continue;
/* seek */ /* seek */
if (ebml_read_seek(matroska, if (url_fseek(matroska->ctx->pb, offset, SEEK_SET) != offset)
seekhead[i].pos+matroska->segment_start) < 0)
continue; continue;
/* we don't want to lose our seekhead level, so we add /* we don't want to lose our seekhead level, so we add
...@@ -1069,7 +1059,7 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska) ...@@ -1069,7 +1059,7 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)
} }
/* seek back */ /* seek back */
ebml_read_seek(matroska, before_pos); url_fseek(matroska->ctx->pb, before_pos, SEEK_SET);
matroska->level_up = level_up; matroska->level_up = level_up;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment