logo       

Re: [patch] xine-engine/video_out.c: msg#00047

video.xine.devel

Subject: Re: [patch] xine-engine/video_out.c

Hi Dan,

On Fri, 2003-08-01 at 20:58, Dan Dennedy wrote:
> Basically, I accomplish this by creating audio and video ports using
> "none." Then, on suspend, I use xine_post_wire_video_port() to the none
> port, close the drivers (ports), and pause the stream. Then, on resume,
> I create new audio/video ports using "auto" or whatever, start playback,
> and call xine_post_wire_video_port() to the newly allocated port.
>
> Believe it nor not, this works! Well, I did have to change something in
> xine-engine/video_out.c to make it safe. I do not think it is the best
> solution, but I have struggled and failed to develop a better one.
> Basically, what happens is that after vo_exit() is called, there are
> still some frames held by the video decoder because it will often crash
> in one of the callbacks upon resume.


yes, i guessed this would be a problem... not easy to solve i think.


> I have not been able to figure out
> how to make the decoder return all these frames. So, I try to make it
> exit the callbacks and avoid bad pointers. Essentially, the
> free_img_buf_queue and display_img_buf_queue track these frame objects,
> except frames can be retrieved by a decoder plugin and are no longer
> tracked by these queues. Therefore, the engine must trust these decoder
> plugins, but maybe it shouldn't. I have tried telling the decoder to
> flush, but it just tells the plugin to flush, which it apparanlty does
> not do correctly. Or, I misunderstand the purpose of the decoder plugin
> flush callback.


the "flush" is meant to force drawing any currently decoded frame. what
you want would be more like a "reset" but i just checked the code for
libmpeg2 and i doesn't really free the frames.

your patch looks harmless, so we might even commit if nobody disagree.
however i'm not sure this completely fixes your problem: as you have
disposed the driver, the (shared) memory used by frames is probably not
available anymore. in that case the decoder itself might crash if it
tries to use the frame as reference.

i guess the only really safe solution would be closing and reopening the
video decoder.


regards,

Miguel




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise