diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavformat/concatdec.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavformat/concatdec.c')
| -rw-r--r-- | ffmpeg/libavformat/concatdec.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ffmpeg/libavformat/concatdec.c b/ffmpeg/libavformat/concatdec.c index 5359ad1..86f82e0 100644 --- a/ffmpeg/libavformat/concatdec.c +++ b/ffmpeg/libavformat/concatdec.c @@ -23,6 +23,7 @@ #include "libavutil/parseutils.h" #include "avformat.h" #include "internal.h" +#include "url.h" typedef struct { char *url; @@ -216,6 +217,8 @@ static int concat_read_header(AVFormatContext *avf) } if (ret < 0) FAIL(ret); + if (!cat->nb_files) + FAIL(AVERROR_INVALIDDATA); for (i = 0; i < cat->nb_files; i++) { if (cat->files[i].start_time == AV_NOPTS_VALUE) @@ -276,6 +279,9 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt) (ret = open_next_file(avf)) < 0) break; } + if (ret < 0) + return ret; + delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time, AV_TIME_BASE_Q, cat->avf->streams[pkt->stream_index]->time_base); @@ -341,7 +347,7 @@ static int real_seek(AVFormatContext *avf, int stream, return ret; ret = try_seek(avf, stream, min_ts, ts, max_ts, flags); - if (ret < 0 && !(flags & AVSEEK_FLAG_BACKWARD) && + if (ret < 0 && left < cat->nb_files - 1 && cat->files[left + 1].start_time < max_ts) { if ((ret = open_file(avf, left + 1)) < 0) |
