[bug] serious init issue in videoplayer (1 Viewer)

deebo

Portal Pro
April 19, 2006
233
3
im making a patch to make subtitle streams play and report properly in the ui

but this is happening:

2006-12-24 23:35:33.988500 [Debug][MPMain]: FStreams is NULL!
2006-12-24 23:35:34.035375 [Info.][MPMain]: VideoPlayer:Duration:2846,17944335938
2006-12-24 23:35:34.035375 [Debug][MPMain]: Fstreams INIT!

problem:

in VideoPlayerVMR7.cs

at the end of Play(file string) is a call to AnalyseStreams(); that creates an instance of FilterStreams that has info on video/audio/subtitle streams.

BUT something calls getSubtitleStreams() before AnalyseStreams() has run

resulting in a serious error where the streaminfo object FStreams is still null when its actually needed

this doesnt affect player since its (wrongly) using vobsub only.
it affects players functions to list subtitle stream choices in containers where subtitle streams are possible (this is what my patch fixes)

INFO: this wasnt an issue in a ~month old svn checkout, so something has changed elsewhere in the code that makes this happen, my patch worked perfectly earlier, it stopped working when i updated my working copy
 

deebo

Portal Pro
April 19, 2006
233
3
bump

this is kinda killing my progress, and since theres no good documentation on how mp actually works i cant solve this on my own atm :p

unless a quick hack like while(!inited){} is in place instead of proper mutex/lock system :p
 

deebo

Portal Pro
April 19, 2006
233
3
its
public override int SubtitleStreams

havent tested it in a while, i suppose the problem still exists

ill test and check, atleast there hasnt been any big changes in vmr7player that vmr9 player inherits
 

DalaNorth

Retired Team Member
  • Premium Supporter
  • December 18, 2006
    142
    1
    46
    Skellefteå, Sweden
    Home Country
    Sweden Sweden
    Well, it is obviously a bug. Early in Play(), the method GetInterfaces() is called. This method contains the line: for (int i = 0; i < SubtitleStreams; ++i)
    And the getter for SubtitleStreams assumes that FStreams is not null, which it probably will be since AnalyseStreams isn't called until later in the Play() method.

    However, I don't know much about how this code works, so I can't really do anything about it. For instance, I don't know if the call to AnalyseStreams can be made earlier or if the for loop in GetInterfaces() can be moved somewhere else, but I'm sure there is someone here that can help you.
     

    deebo

    Portal Pro
    April 19, 2006
    233
    3
    im not the one needing the help, the code is :)

    i dont understand the architechture of MP that well, and since there is close to zero documentation i cant fix this, thats why i posted it in the first place
     

    deebo

    Portal Pro
    April 19, 2006
    233
    3
    oh and previously this could be fixed by turning off the separate ui thread (?) but the possibility to turn it off was removed from configuration -> general
     

    Users who are viewing this thread

    Top Bottom