summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-04 00:46:23 +0200
committerwm4 <wm4@nowhere>2013-09-04 01:42:52 +0200
commit1ef0d02245971af8d0980029e36ccbb1c28a3133 (patch)
tree4818661a1f494b4385757b621da57a9c648cd26d
parent74be07c36d922a8a62ce7753a95c81885d9881d7 (diff)
downloadmpv-1ef0d02245971af8d0980029e36ccbb1c28a3133.tar.bz2
mpv-1ef0d02245971af8d0980029e36ccbb1c28a3133.tar.xz
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.)
-rw-r--r--stream/tv.c8
1 files changed, 6 insertions, 2 deletions
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 */