From 266ce242c34ac0836934317b7cccb8f7b82b4108 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 4 Sep 2013 00:46:23 +0200 Subject: tv: attempt to support mjpeg streams MPlayer handles this correctly, because MPlayer still has the FourCC codec dispatch (codecs.conf). We need to handle this case specially, because the libavformat rawvideo decoder will of course not eat mjpeg. mjpeg is the only supported format, though. (Even MPlayer needs to convert between V4L2 formats and MPlayer FourCCs, and mjpeg is the only non-raw format.) --- stream/tv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'stream') diff --git a/stream/tv.c b/stream/tv.c index 3a2064d247..3b1a8a2cfc 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -729,8 +729,12 @@ static int demux_open_tv(demuxer_t *demuxer, enum demux_check check) /* get IMAGE FORMAT */ int fourcc; funcs->control(tvh->priv, TVI_CONTROL_VID_GET_FORMAT, &fourcc); - sh_video->gsh->codec = "rawvideo"; - sh_video->format = fourcc; + if (fourcc == MP_FOURCC_MJPEG) { + sh_video->gsh->codec = "mjpeg"; + } else { + sh_video->gsh->codec = "rawvideo"; + sh_video->format = fourcc; + } /* set FPS and FRAMETIME */ -- cgit v1.2.3