changeset 5325:feffcbc89904 libavformat

Fixes detection and error reporting of non-existing files in img2.c. Patch by Samuli Valo: name surname picturall com
author benoit
date Thu, 22 Oct 2009 16:27:01 +0000
parents 3616c1434288
children 4e1e9ab777a1
files img2.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/img2.c	Wed Oct 21 01:25:39 2009 +0000
+++ b/img2.c	Thu Oct 22 16:27:01 2009 +0000
@@ -128,7 +128,9 @@
         if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0){
             *pfirst_index =
             *plast_index = 1;
-            return 0;
+            if(url_exist(buf))
+                return 0;
+            return -1;
         }
         if (url_exist(buf))
             break;
@@ -221,7 +223,7 @@
 
     if (!s->is_pipe) {
         if (find_image_range(&first_index, &last_index, s->path) < 0)
-            return AVERROR(EIO);
+            return AVERROR(ENOENT);
         s->img_first = first_index;
         s->img_last = last_index;
         s->img_number = first_index;