Download for Windows Download for Linux Download for FreeBSD Download for Mac Manual Wiki Forum IRC Trac

Tuesday, July 22, 2008

Random code-snippets from VSFilter

I've been reading and hacking on the VSFilter code more than is probably healthy, and have over the time found a lot of funny/strange clips of code.

For example, this line in GFN.cpp (Get File Name):

CString filename = title + _T(".nooneexpectsthespanishinquisition");


In VSFilter.cpp you can find this gem:
/*removeme*/
JajDeGonoszVagyok();



Do you know the "opaque box" background style supported? As an alternative to wide outlines? Well here's how it's created:
CStringW str;
str.Format(L"m %d %d l %d %d %d %d %d %d",
-w, -w,
m_width+w, -w,
m_width+w, m_ascent+m_descent+w,
-w, m_ascent+m_descent+w);

m_pOpaqueBox = new CPolygon(style, str, 0, 0, 0, 1.0/8, 1.0/8, 0);

Yup, it creates a drawing object, by a string. While it is a bit clever (the alternative would be much more code) it has some bad problems which you may have seen if you've used it yourself: If for any reason it needs to create multiple boxes, such as when you have multiple lines, the boxes will overlap and a non-zero alpha will make that look really bad.

I wonder how long this line has been sitting there:
// TODO: handle collisions == 1 (reversed collisions)


Maybe pre-buffering could be more useful if this was actually implemented:
STDMETHODIMP_(bool) CRenderedTextSubtitle::IsAnimated(POSITION pos)
{
// TODO
return(true);
}


I still find this the weirddest part... there is a CPP file with a stange name. It contains among other things this function:
#define LEN1 (countof(str1))
#define LEN11 (countof(str1[0]))
#define LEN2 (countof(str2))
#define LEN3 (countof(str3))

static void dencode()
{
int i, j;
for(i = 0; i < LEN1; i++) for(j = 0; j < LEN11; j++) str1[i][j] ^= 0x12;
for(i = 0; i < LEN2; i++) str2[i] ^= 0x34;
for(i = 0; i < LEN3; i++) str3[i] ^= 0x56;
}

If you think it looks like XOR en/decryption you're right. That's exactly what it is.

It's from the file containing the void JajDeGonoszVagyok() function, and it's called "valami.cpp". This file also contains one other strangely named function: bool HmGyanusVagyTeNekem(IPin* pPin)

Both of those functions decrypt some strings written as arrays of numbers. These strings are the names of registry keys of other DirectShow filters. The JajDeGonoszVagyok function then detects the highest merit of all those filters and makes sure that DirectVobSub itself gets a merit higher than any of those... I think this is the DirectShow version of the "law of the jungle".

Related Posts by Categories



60 comments:

  1. As equinox so wisely remarked, Gabest gives a new definition to "hungarian notation".

    Or, as movax said, vsfilter is like the Millennium Falcon.

    ReplyDelete
  2. Great article! I've been doing some hacking myself, searching for a way to set the subtitle source file name programatically from within a DirectShow app. Is this doable?

    ReplyDelete
  3. You can do all king of programming so easily if you can d typing fastly. The typing services uk is all about typing techniques that will help you to done your work.

    ReplyDelete


  4. The share your really gives us excitement. Thanks for your sharing. If you feel tired at work or study try to participate in our games to bring the most exciting feeling. Thank you!
    hotmail login | red ball | 192.168.1.1

    ReplyDelete
  5. The blog or and best that is extremely useful to keep I can share the ideas of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.
    animal jam | five nights at freddy's | hotmail login

    ReplyDelete
  6. Thank you for the information. This is well written and gives a lot of value for people who are looking to learn

    ReplyDelete
  7. Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging.
    bollywood gossip
    serial actresses hot photos

    ReplyDelete
  8. The article you have shared here very good. This is really interesting information for me. Thanks for sharing!
    hotmail login |hotmail sign in |free hotmail login

    ReplyDelete
  9. You will meet amazing and beautiful people that may be the same as you or complete different

    ReplyDelete
  10. I found a lot of information here to create this actually best for all newbie here. Thank you for this information. Obat Wasir

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. Very interesting blog. A lot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know.
    "Friv 5 online games assist develop rotor skills. They enhance eye coordination. This is essential to growing children. Eye coordination has a lot to do with different features of the senses and this page with games are due to this fact very useful to younger minds."

    ReplyDelete
  13. I find this post to be very interesting, and I can say that this is very professional and unique. This is one of the pages I have been to, which I can term as relevant and go an extent of bookmarking. While at that, if you are looking for the best Two way ANOVA Test Help, we could be of great help. we provide the most reliable services, assistance that is provided when and where necessary. We guarantee the best.

    ReplyDelete
  14. Finest benefit regarding in this manner of promoting your brand name is that you will certainly get possible purchasers without involving middle men. buy targeted usa facebook likes

    ReplyDelete
  15. Thanks for the information you shared. Please share useful information with your viewers regularly
    theworldseasiestgame.com worldshardestgame.online governorofpoker2.co

    ReplyDelete
  16. Amazing images of light and landscape

    jump official coach factory outlet online to contentmy subreddits

    limit my search to r/EarthPornuse the following search parameters to narrow your results:see the coach factory online sale search faq for details.

    The location of the area in cheap coach purses the photo.

    When it comes to location, the more specific the better. If you Coach Outlet Store Online wish to not disclose the location you should at the very least name the state/country. a lake, mountain): if one can find the place immediately by searching it in google it coach outlet store online fine. For possibly ambiguous locations official coach outlet online add state/country for safety.

    ReplyDelete
  17. I am convinced that your website is convinced that weblog is very new. Probably I am going to bookmark your site. There are certainly impressive stories. Passion for sharing your website with us.
    Regards - www.office.com/setup

    ReplyDelete
  18. Su presentación es muy detallada y preparada profesionalmente. Usted delinea sus puntos de una manera sistemática y cronológica y el tema se comunicó de manera efectiva a la audiencia. ¿Sabías que los juegos Friv en línea son las mejores actividades que consisten en varios entretenimientos hermosos para ayudar a mover el tiempo? También porque Friv 2020 ha recibido una gran reputación en todo el mundo por toda la diversión que ofrece en casa. Hay muchos participantes en la red que buscan un asiento frente a la computadora y se divierten con diversas actividades, como juegos Friv 2020 divertidos de varios tipos, entrar aquí para comenzar a jugar gratis. El juego friv global se puede adquirir para jugar en cualquier lugar siempre que haya una conexión de red. Gracias!

    ReplyDelete
  19. Hey, my dear friends, if you are hunting for a wild look Michael Kors Handbags Outlet at a reasonable price; you really should not miss this Michael Kors Handbags On Sale. It is truly a qualifying item. (tags: Michael Kors Outlet Online,Michael Kors Sale,Michael Kors Outlet)
    It posted by Michael Kors Outlet Store.

    ReplyDelete
  20. http://www.bape-hoodie.us.com
    http://www.longchamphandbagsoutlets.com
    http://www.kd-10.us
    http://www.asics-shoes.us.org
    http://www.nikefoamposite.us.com
    http://www.yeezyboost-350.com.co
    http://www.adidasyeezys.us.com
    http://www.yeezyboost350v2.org.uk
    http://www.jordan11retro.us.com
    http://www.jewelrypandora.in.net

    ReplyDelete
  21. Designer Exposure es un buen lugar para comprar su Bolsos Michael Kors original.
    The Woven Tote es también una selección impresionante en el Bolsos Michael Kors Baratos.
    Bolso de alta calidad que debe contemplar absolutamente un Bolsos Michael Kors Outlet.
    Du kommer att upptäcka en handfull detaljer som du kan förvänta dig att komma över på en vanlig Michael Kors Rea.
    Du kan hitta ett antal platser som ger Väska Michael Kors.
    Sortimentet är fantastiskt för alla som letar efter en MK Väska.
    Håll dina ögon öppna för den här säsongens val som kommer att presenteras under bara några månader och det kommer utan tvekan att bli spektakulärt.

    ReplyDelete
  22. I just got to be distinctly aware of your blog through Google, and found that it's genuinely informative. I will watch your writing skill and ideas. I will acknowledge on the off chance that you proceed with this in future. Various individuals will be profited from your writing.


    Motorwars2.com
    Bulletforce.org

    ReplyDelete
  23. The article is very interesting. And I also want to share articles about health, I'm sure this will be useful. Read and share it. Thank you very much :)

    Pengobatan Alternatif TBC Tulang

    ReplyDelete

  24. [url=http://driverforhp.com/]DIRVER HP DOWNLOAD[/url]

    [url=https://www.pubglitedownload.com/]PUBG MOBILE LITE DOWNLOAD FULL VERSION[/url]

    [url=http://driver-hp.net/]DIRVER HP PRINTER DOWNLOAD FREE[/url]

    ReplyDelete

  25. The article is very interesting. And I also want to share articles about health, I'm sure this will be useful. Read and share it. Thank you very much :)

    Obat Mujarab untuk Penyakit Epilepsi
    Cara Mengobati Penyakit Mata Ikan
    Pengobatan Epilepsi secara Tradisional

    ReplyDelete


  26. Not sure who helped you, but if you told me when, I could figure it out. The Gift Shop is also our office so at times the person is very busy. Thank you for writing. urban t shirts Filicudi was meant to be a harsh negan shirt prison but turned out a holiday retreat for them. They slept in frescoed kingsize bedrooms with terraces and smooth tile floors made of ancient painted majolicas. For meals, they ate for free at taverns with rainbow coloured chairs and tables under thatched porches, where they got to devour gourmet sloth shirt dishes locals could only dream of.

    ReplyDelete

  27. Enjoyed studying this, very good stuff, thanks.
    Here is a good Weblog You might Come across Fascinating that we Encourage You
    โปรโมชั่นGclub ของทางทีมงานตอนนี้แจกฟรีโบนัส 50%
    เพียงแค่คุณสมัคร Gclub กับทางทีมงานของเราเพียงเท่านั้น
    ร่วมมาเป็นส่วนหนึ่งกับเว็บไซต์คาสิโนออนไลน์ของเราได้เลยค่ะ
    สมัครสล็อตออนไลน์ >>> goldenslot
    สนใจร่วมลงทุนกับเรา สมัครเอเย่น Gclub คลิ๊กได้เลย

    ReplyDelete
  28. Here is a good Weblog You might Come across Fascinating that we Encourage Youเว็บไซต์คาสิโนออนไลน์ที่ได้คุณภาพอับดับ 1 ของประเทศ
    เป็นเว็บไซต์การพนันออนไลน์ที่มีคนมา สมัคร Gclub Royal1688
    และยังมีหวยให้คุณได้เล่น สมัครหวยออนไลน์ ได้เลย
    สมัครสมาชิกที่นี่ >>> Gclub Royal1688
    ร่วมลงทุนสมัครเอเย่นคาสิโนกับทีมงานของเราได้เลย

    ReplyDelete
  29. No matter what type of Michael Kors Bags Outlet each individual got, they all had one thing in common. We all know that getting something on sale is like winning a mini lottery, but to find a name brand handbag like Michael Kors Black Friday Sale for instance, discounted is like a slice of heaven on earth. I have personally attacked my husband with hugs and kisses when finding Official Coach Outlet Online at discounted prices.

    Michael Kors Factory Outlet stores can be found in malls all over. MK Outlet and other Coach merchandise can also be found in some boutiques. Inspired by the same material baseball gloves are made from, these Coach Bags On Sale Online are versatile and stylish. Since it's conception, the Michael Kors Handbags Outlet has been produced into a variety of designs, colors, shapes, and styles that have won top pick of millions of women the world over.

    New Michael Kors Bags are the most sought after handbag. Since Coach Outlet Online is one of the most recognized name brands in the world of fashion, you will find A-list celebrities down to small girls wearing them.

    tags:Coach Outlet|Coach Bags Factory Outlet|Coach Purses Outlet

    ReplyDelete
  30. A beautiful purse or handbag from Coach Outlet Online can last for many years, and represent a great overall value.
    There are Michael Kors Bags Outlet in a large number of shopping malls located throughout the country.
    Cheap Michael Kors Bags is a great way to determine which models best suit your needs.
    Official Coach Factory Outlet Online all strive to provide comfort and convenience for their owners and the seams are double-stitched for maximum durability.
    Michael Kors Factory Store, has one of the most popular handbag and accessory lines on the market today.
    Coach Handbags Wholesale says a lady is classy, elegant and sophisticated.
    Coach Store Near Me trends come and go, but a Coach stands the test of time.
    The official Michael Kors Handbags On Sale Outlet regularly posts various handbags being offered for sale.
    Compare your Coach Bags On Sale Outlet to the logo provided on the website to make sure it is similar.
    All Michael Kors Outlet Online Store have serial numbers.

    ReplyDelete
  31. The writers at our company have sufficient experience in creating high-quality Legit Essay Writing Service and we always ensure that we provide quality Custom Writing Services to all.

    ReplyDelete
  32. I hope this post of yours will be more appreciated by it really excellent, i enjoyed it, thanks for posting it. I do not feel sorry for taking the time to read this post, it is really nice and useful to me, thanks for posting it.
    abcya 4, io jogos for school, friv 4 school games 2019, cá koi mini

    ReplyDelete
  33. We are the best writing company providing Custom Dissertation Writing Service combined with a vast array of services. We offer College Term Paper Writing Services, essay assistance, dissertation writing services and research writing help.

    ReplyDelete

If you need help with Aegisub or have a bug report please use our forum instead of leaving a comment here. If you have a feature request, please go to our UserVoice page.

You will get better help on our forum than in the blog comments.