changeset 5049:d8613bee3863 libavformat

Print meaningful error messages when url_fopen fails.
author jai_menon
date Sat, 20 Jun 2009 09:00:12 +0000
parents d44e963aaf1c
children 3769dc8df347
files img2.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/img2.c	Sat Jun 20 06:09:30 2009 +0000
+++ b/img2.c	Sat Jun 20 09:00:12 2009 +0000
@@ -264,8 +264,10 @@
                                   s->path, s->img_number)<0 && s->img_number > 1)
             return AVERROR(EIO);
         for(i=0; i<3; i++){
-            if (url_fopen(&f[i], filename, URL_RDONLY) < 0)
+            if (url_fopen(&f[i], filename, URL_RDONLY) < 0) {
+                av_log(s1, AV_LOG_ERROR, "Could not open file : %s\n",filename);
                 return AVERROR(EIO);
+            }
             size[i]= url_fsize(f[i]);
 
             if(codec->codec_id != CODEC_ID_RAWVIDEO)
@@ -340,8 +342,10 @@
                                   img->path, img->img_number) < 0 && img->img_number>1)
             return AVERROR(EIO);
         for(i=0; i<3; i++){
-            if (url_fopen(&pb[i], filename, URL_WRONLY) < 0)
+            if (url_fopen(&pb[i], filename, URL_WRONLY) < 0) {
+                av_log(s, AV_LOG_ERROR, "Could not open file : %s\n",filename);
                 return AVERROR(EIO);
+            }
 
             if(codec->codec_id != CODEC_ID_RAWVIDEO)
                 break;