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



36 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

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.