Re: Bug in IFileSourceFilter

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Alessandro Angeli [MVP::DigitalMedia] (nobody_at_nowhere.in.the.net)
Date: 09/29/04


Date: Wed, 29 Sep 2004 22:29:33 +0200

godofcpu wrote:

> Maybe my current problem has something to do with it not
> unlocking correctly since it was locked for write by one
> object and read for another? Is there a special order
> that I should be stopping things in such a case, i.e.
> stop the writer and release it before stopping the reader
> or vice versa?

I'd try to delete the file after stopping both reader and
writer and destroying both filters (either destroying the
graphs or removing the filters).

> I also found it strange that media player
> can work with wma files fine, although it does sometimes
> seem to keep a file lock on some files for unusually
> long, after it has finished playing them. I sometimes
> have to wait a bit after I have loaded a new song to
> delete the previously playing one from explorer. I also
> found other people with similar problems which made me
> think it could of been a bug
>
http://groups.google.com/groups?q=ifilesourcefilter%20close&hl=en&lr=&ie=UTF-8&sa=N&tab=wg

This thread actually makes one wonder. However, the cases
seem to be different:

- one reads a MIDI with the AsyncFileReader

- one reads a WAV with the AsyncFileReader

- one uses the WindowsMediaEncoder and who knows what filter
WME uses (but, since the poster is the same as before, it
may be a WAV read through the AsyncFileReader)

- you read a WMA with the WindowsMediaSourceFilter or the
WMASFReader (depending on how you build the graph)

I don't think the WM readers and the AsyncFileReader share
any code and it is unlikely they have the same bug (besides,
most applications run fine with them).

A note: the Explorer on XP/2003 tries to preview the file
when you select it and so it locks the file before you can
delete it and the locks lasts sometimes for seconds or
minutes, depending on the file type and size. This may
account for the difficulty deleting files from Explorer,
while it wouldn't happen when deleting the file from the
command line (which is something you could try).

Something else that may be going on behind your back is that
the graph takes a bit of time to release all its resources
and thus there may be a delay between the call to Release()
and the time when the graph actually self-destructs. If this
is the case, you may try to delete the file a few times and
see whether you succeed after a while.

-- 
// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net


Relevant Pages

  • Re: Windows Explorer using all CPU resources
    ... Using Process Explorer, locating the file that is using ... the resources shows Explorer.exe to be the culprit. ... Selecting the Performance Graph shows CPU Useage ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: [RFC, PATCH] locks: remove posix deadlock detection
    ... whether we're adding a cycle to an arbitrary directed acyclic graph. ... It seems unlikely to be useful to applications: ... file locks; deadlocks involving network filesystems or other kinds ... It therefore seems best to remove deadlock detection. ...
    (Linux-Kernel)
  • Re: [RFC, PATCH] locks: remove posix deadlock detection
    ... whether we're adding a cycle to an arbitrary directed acyclic graph. ... file locks; deadlocks involving network filesystems or other kinds ... It therefore seems best to remove deadlock detection. ...
    (Linux-Kernel)
  • Re: Plotting Graphs in MFC application
    ... You can see examples of graphs in my Thead Affinity Explorer and Async Explorer, ... My requirement is to plot the Sine wave graph in my MFC desktop ... Or we need to third party code? ...
    (microsoft.public.vc.mfc)
  • Re: Line Graph?
    ... fit the control, particularly if the control can be resized. ... You would have to draw the axes so that line has meaning. ... You can find examples of simplistic graphs in my OpenMP Explorer or Thread Affinity ... Dundas controls have a graph component, ...
    (microsoft.public.vc.mfc)