summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-12-15 15:28:35 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-12-15 15:28:35 +0100
commitf425a55a5fc773282828dc6e1df887827d531ca5 (patch)
tree52d40ef4b7cd993f3a80247387992641e1170c48
parente223601e6ac48e0c4829c77c016a38ee21b5633a (diff)
avformat: added more debug logging
-rw-r--r--modules/avformat/avformat.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/avformat/avformat.c b/modules/avformat/avformat.c
index c0338a2..68ef088 100644
--- a/modules/avformat/avformat.c
+++ b/modules/avformat/avformat.c
@@ -252,6 +252,8 @@ static int alloc(struct vidsrc_st **stp, const struct vidsrc *vs,
if (!stp || !vs || !prm || !size || !frameh)
return EINVAL;
+ debug("avformat: alloc dev='%s'\n", dev);
+
st = mem_zalloc(sizeof(*st), destructor);
if (!st)
return ENOMEM;
@@ -270,6 +272,12 @@ static int alloc(struct vidsrc_st **stp, const struct vidsrc *vs,
#if LIBAVFORMAT_VERSION_INT >= ((52<<16) + (110<<8) + 0)
(void)fmt;
ret = avformat_open_input(&st->ic, dev, NULL, NULL);
+ if (ret < 0) {
+ warning("avformat: avformat_open_input(%s) failed (ret=%d)\n",
+ dev, ret);
+ err = ENOENT;
+ goto out;
+ }
#else
/* Params */
@@ -284,12 +292,14 @@ static int alloc(struct vidsrc_st **stp, const struct vidsrc *vs,
ret = av_open_input_file(&st->ic, dev, av_find_input_format(fmt),
0, &prms);
-#endif
-
if (ret < 0) {
+ warning("avformat: av_open_input_file(%s) failed (ret=%d)\n",
+ dev, ret);
err = ENOENT;
goto out;
}
+#endif
+
#if LIBAVFORMAT_VERSION_INT >= ((53<<16) + (4<<8) + 0)
ret = avformat_find_stream_info(st->ic, NULL);