[FFmpeg-devel] patches for dshow: handle events in graph and CoUninitialize

Don Moir donmoir at comcast.net
Thu Dec 13 22:35:33 CET 2012


These patches from Ramiro Polla fix problems where dshow can hang and the patches have been submitted but not applied.

I don't know how you go about reviewing the patches or who might be doing that. They have been reviewed by Ramiro and me and tested. 
I am not sure anyone else that has dshow experience will be looking at them.

There is one more thing that needs to change but probably best to commit these patches first in order to avoid confusion.

The thing that needs to change is:

dshow_add_device calls dshow_read_close on error and that call just needs to be removed. This is because CoUninitialized is called 
in dshow_read_close and it would end up being called twice. It's also sufficient to just return the error code.

So in dshow_add_device:

        if (codec->pix_fmt == AV_PIX_FMT_NONE) {
            codec->codec_id = dshow_codecid(bih->biCompression);
            if (codec->codec_id == AV_CODEC_ID_NONE) {
                av_log(avctx, AV_LOG_ERROR, "Unknown compression type. "
                                 "Please report verbose (-v 9) debug information.\n");
// remove dshow_read_close - its not needed and can cause trouble
-                dshow_read_close(avctx);
                return AVERROR_PATCHWELCOME;
            }
            codec->bits_per_coded_sample = bih->biBitCount;
        } else 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-dshow-call-CoUninitialize-on-dshow_read_close.patch
Type: application/octet-stream
Size: 1574 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121213/11b71fee/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-dshow-handle-events-in-graph.patch
Type: application/octet-stream
Size: 6161 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121213/11b71fee/attachment-0001.obj>


More information about the ffmpeg-devel mailing list