Commit 7f42276a authored by Marton Balint's avatar Marton Balint

avformat/concatdec: always allow seeking to start

Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent f9e94784
...@@ -692,6 +692,13 @@ static int real_seek(AVFormatContext *avf, int stream, ...@@ -692,6 +692,13 @@ static int real_seek(AVFormatContext *avf, int stream,
left = 0; left = 0;
right = cat->nb_files; right = cat->nb_files;
/* Always support seek to start */
if (ts <= 0)
right = 1;
else if (!cat->seekable)
return AVERROR(ESPIPE); /* XXX: can we use it? */
while (right - left > 1) { while (right - left > 1) {
int mid = (left + right) / 2; int mid = (left + right) / 2;
if (ts < cat->files[mid].start_time) if (ts < cat->files[mid].start_time)
...@@ -728,8 +735,6 @@ static int concat_seek(AVFormatContext *avf, int stream, ...@@ -728,8 +735,6 @@ static int concat_seek(AVFormatContext *avf, int stream,
AVFormatContext *cur_avf_saved = cat->avf; AVFormatContext *cur_avf_saved = cat->avf;
int ret; int ret;
if (!cat->seekable)
return AVERROR(ESPIPE); /* XXX: can we use it? */
if (flags & (AVSEEK_FLAG_BYTE | AVSEEK_FLAG_FRAME)) if (flags & (AVSEEK_FLAG_BYTE | AVSEEK_FLAG_FRAME))
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
cat->avf = NULL; cat->avf = NULL;
......
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