From: <oz...@al...> - 2004-07-05 16:48:29
|
On 05/07/2004, at 10:44 AM, tma...@no... wrote: >> One solution I tried (which I was surprised didn't work) was to = change >> video_out.c:447 from >> >> stream->first_frame_flag =3D (this->grab_only) ? 0 : 1; >> >> to >> >> stream->first_frame_flag =3D 1; >> >> since it seemed like, well, the first_frame_flag wasn't getting set. >> However, now that it _is_ getting set, for some reason the >> pthread_cond_timedwait in xine.c:1076 still isn't returning :(. > > Thinking about it, you're absolutely right, it cannot work, the=20 > signal is raised by the video_out thread, and in your case there is no=20= > video_out thread. > The first frame thing must be bypassed if the video port is a=20 > framegrab port. That makes plenty of sense now I've poked around the code a bit more. =20= So, in my last message, I wrote ... On 05/07/2004, at 12:34 PM, Andr=E9 Pang wrote: > After a bit more digging around (it's amazing how much better your=20 > brain works after it's had some sleep ...), I'm a bit closer to=20 > finding out what's going on. If you look at video_out.c:446, there's=20= > this bit of code there: > > if (stream->first_frame_flag =3D=3D 2) { > stream->first_frame_flag =3D (this->grab_only) ? 0 : 1; > img->is_first =3D FIRST_FRAME_MAX_POLL; > > lprintf ("get_next_video_frame first_frame_reached\n"); > } > > If I add a "pthread_cond_broadcast(&stream->first_frame_reached);"=20 > directly after the lprintf, it works. Is that a fair solution to the problem? I don't think I know the code=20= well enough to say whether that's a good solution or not. It certainly=20= works, but should I be signalling the first_frame_reached condition=20 variable there, perhaps with a grab_only guard around it? That block=20 of code could be rewritten, e.g. as: if (stream->first_frame_flag =3D=3D 2) { img->is_first =3D FIRST_FRAME_MAX_POLL; if (this->grab_only) { stream->first_frame_frag =3D 0; pthread_cond_broadcast(&stream->first_frame_reached); } else { stream->first_frame_flag =3D 1; } lprintf ("get_next_video_frame first_frame_reached\n"); } --=20 % Andre Pang : trust.in.love.to.save |