In DirectShow, the PULL mode Source Filter causes Slow playback of large files.

Source: Internet
Author: User

In the built-in example of DirectShow, There Is A Pull Mode Source Filter Example.Program(Async), The read () function is called in its load () function (load source file, here it reads the entire source file into the memory (So playing a small file does not affect the playing of large files and it takes a long time to start)

My original processing is:

Let the read () function first read the appropriate data, then start a sub-thread and then read the data, and the main thread starts to connect to the graph for playing, which can be achieved, but there are two problems: a. although a small amount of data is read-only, the parameter passed down is the total size of the file, as if it is very time-consuming (its size (), setpoinyer () when the stream class uses it (), REAG () All three functions use the file size parameter), but it is much faster than B. at this time, if the Sub-thread data has not been read, there will be a problem with the fast forward, because the fast forward to the position where there is no data, the screen will remain unchanged.

Later I used the memory ing file to solve the problem :)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.