linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xawtv: release buffer if it can't be displayed
@ 2013-03-30  9:47 Hans Verkuil
  2013-03-31 12:48 ` Hans de Goede
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Verkuil @ 2013-03-30  9:47 UTC (permalink / raw)
  To: linux-media; +Cc: Hans de Goede

This patch for xawtv3 releases the buffer if it can't be displayed because
the resolution of the current format is larger than the size of the window.

This will happen if the hardware cannot scale down to the initially quite
small xawtv window. For example the au0828 driver has a fixed size of 720x480,
so it will not display anything until the window is large enough for that
resolution.

The problem is that xawtv never releases (== calls QBUF) the buffer in that
case, and it will of course run out of buffers and stall. The only way to
kill it is to issue a 'kill -9' since ctrl-C won't work either.

By releasing the buffer xawtv at least remains responsive and a picture will
appear after resizing the window. Ideally of course xawtv should resize itself
to the minimum supported resolution, but that's left as an exercise for the
reader...

Hans, the xawtv issues I reported off-list are all caused by this bug and by
by the scaling bug introduced recently in em28xx. They had nothing to do with
the alsa streaming, that was a red herring.

Regards,

	Hans

diff --git a/x11/x11.c b/x11/x11.c
index 5324521..b203d84 100644
--- a/x11/x11.c
+++ b/x11/x11.c
@@ -152,8 +152,10 @@ int
 video_gd_blitframe(struct video_handle *h, struct ng_video_buf *buf)
 {
     if (buf->fmt.width  > cur_tv_width ||
-	buf->fmt.height > cur_tv_height)
+	buf->fmt.height > cur_tv_height) {
+	ng_release_video_buf(buf);
 	return -1;
+    }
 
     if (cur_filter)
 	buf = video_gd_filter(h,buf);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-02  8:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-30  9:47 [PATCH] xawtv: release buffer if it can't be displayed Hans Verkuil
2013-03-31 12:48 ` Hans de Goede
2013-04-01 10:19   ` Hans Verkuil
2013-04-01 14:23     ` Hans de Goede
2013-04-01 14:39       ` Hans Verkuil
2013-04-02  9:02         ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).