Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (7118): dvb-ttpci: Improved display of still pictures

Improved display of still pictures (VIDEO_STILLPICTURE ioctl).
Ensure that both fields are displayed for progressive frames.

Thanks to Reinhard Nissl and Klaus Schmidinger for finding out
that the FREEZE command does this.

Thanks-to: Reinhard Nissl <rnissl@gmx.de>
Thanks-to: Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by

Oliver Endriss and committed by
Mauro Carvalho Chehab
0ed4a6ea 251130bf

+14 -1
+14 -1
drivers/media/dvb/ttpci/av7110_av.c
··· 966 966 static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len, int nonblock) 967 967 { 968 968 int i, n; 969 + int progressive = 0; 969 970 970 971 dprintk(2, "av7110:%p, \n", av7110); 971 972 972 973 if (!(av7110->playing & RP_VIDEO)) { 973 974 if (av7110_av_start_play(av7110, RP_VIDEO) < 0) 974 975 return -EBUSY; 976 + } 977 + 978 + for (i = 0; i < len - 5; i++) { 979 + /* get progressive flag from picture extension */ 980 + if (buf[i] == 0x00 && buf[i+1] == 0x00 && 981 + buf[i+2] == 0x01 && (unsigned char)buf[i+3] == 0xb5 && 982 + (buf[i+4] & 0xf0) == 0x10) 983 + progressive = buf[i+5] & 0x08; 975 984 } 976 985 977 986 /* setting n always > 1, fixes problems when playing stillframes ··· 994 985 dvb_play(av7110, buf, len, 0, 1); 995 986 996 987 av7110_ipack_flush(&av7110->ipack[1]); 997 - return 0; 988 + 989 + if (progressive) 990 + return vidcom(av7110, AV_VIDEO_CMD_FREEZE, 1); 991 + else 992 + return 0; 998 993 } 999 994 1000 995