[FFmpeg-cvslog] lavd/fbdev_dec: use default device when not provided
Lukasz Marek
git at videolan.org
Tue Oct 21 23:00:37 CEST 2014
ffmpeg | branch: master | Lukasz Marek <lukasz.m.luki2 at gmail.com> | Sat Oct 18 19:35:47 2014 +0200| [da833a6d090f95f607f9c8cb00c2b55740d9120c] | committer: Lukasz Marek
lavd/fbdev_dec: use default device when not provided
Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da833a6d090f95f607f9c8cb00c2b55740d9120c
---
libavdevice/fbdev_dec.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/libavdevice/fbdev_dec.c b/libavdevice/fbdev_dec.c
index 1593b10..7b13a85 100644
--- a/libavdevice/fbdev_dec.c
+++ b/libavdevice/fbdev_dec.c
@@ -68,6 +68,7 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
AVStream *st = NULL;
enum AVPixelFormat pix_fmt;
int ret, flags = O_RDONLY;
+ const char* device;
if (!(st = avformat_new_stream(avctx, NULL)))
return AVERROR(ENOMEM);
@@ -77,11 +78,16 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
if (avctx->flags & AVFMT_FLAG_NONBLOCK)
flags |= O_NONBLOCK;
- if ((fbdev->fd = avpriv_open(avctx->filename, flags)) == -1) {
+ if (avctx->filename[0])
+ device = avctx->filename;
+ else
+ device = ff_fbdev_default_device();
+
+ if ((fbdev->fd = avpriv_open(device, flags)) == -1) {
ret = AVERROR(errno);
av_log(avctx, AV_LOG_ERROR,
"Could not open framebuffer device '%s': %s\n",
- avctx->filename, av_err2str(ret));
+ device, av_err2str(ret));
return ret;
}
More information about the ffmpeg-cvslog
mailing list