View Single Post
  #17 (permalink)  
Old 4th July 2005
Tizio Tizio is offline
BS.Player Master
Join Date: Nov 2003
Location: Italy
Posts: 3,037
Rep Power: 26
Tizio will become famous soon enough

I made some search too before posting you that, but to me too the results were "useless"...

Originally Posted by RafkeP
I'm going to try it with a value of 0 and if it doesn't work out I will put the endtime on starttime + 60 seconds. In that way the max subtitle duration should kick in.
Yes, this way all the problems should be handled by BSplayer :D

Another suggestion...
I tried your plugin with a 20fps movie, and the subtitles didn't appear at the right time.
I think it's pretty simple to retrieve the fps rate also in C++.
I've tried in VisualBasic and the code I wrote is this:
Private Const OF_SHARE_DENY_WRITE As Long = &H20
Private Type AVIFileInfo
    dwMaxBytesPerSec As Long
    dwFlags As Long
    dwCaps As Long
    dwStreams As Long
    dwSuggestedBufferSize As Long
    dwWidth As Long
    dwHeight As Long
    dwScale As Long
    dwRate As Long
    dwLength As Long
    dwEditCount As Long
    szFileType As String * 64
End Type
Private Declare Function AVIFileOpen Lib "avifil32" Alias "AVIFileOpenA" (ppfile As Long, ByVal szFile As String, ByVal mode As Long, pclsidHandler As Any) As Long
Private Declare Function AVIFileRelease Lib "avifil32" (ByVal pfile As Long) As Long
Private Declare Function AVIFileInfo Lib "avifil32" Alias "AVIFileInfoA" (ByVal pfile As Long, pfi As AVIFileInfo, ByVal lSize As Long) As Long
Private Declare Sub AVIFileInit Lib "avifil32" ()
Private Declare Sub AVIFileExit Lib "avifil32" ()

Private Sub Form_Load()
    Dim hFile As Long
    Dim AviInfo As AVIFileInfo
    Dim buf As String
    Dim ReturnCode As Long
    'Here below you have to put the routine to retrieve the current played AVI file from BSplayer [ I know that you know how to do this :P ]
    'In C++ is something like this:
    'char buf[MAX_PATH];
    'void *adr;

    'NOT NEEDED IN YOUR CODE (since you have retrieved the file name directly from BSplayer)
    buf = "C:\TEST\TestFPS.avi"
    'Initialize the AVIFile library
    'Create a handle to the AVI file (which path and file name is stored in "buf")
    ReturnCode = AVIFileOpen(hFile, buf, OF_SHARE_DENY_WRITE, ByVal 0&)
    'If the AVI file has been opened correctly
    If ReturnCode = 0 Then
        'Retrieve the AVI information
        If AVIFileInfo(hFile, AviInfo, Len(AviInfo)) = 0 Then
            'Shows a Message Box with the AVI's FramePerSecond rate (rounded at the first 2 decimals)
            MsgBox "AVI info: " & Round(AviInfo.dwRate / AviInfo.dwScale, 2) & "fps"
            MsgBox "Error while retrieving AVI information..."
        End If
        'Release the file handle
        AVIFileRelease hFile
        MsgBox "Error while opening the AVI file..."
    End If
    'Exit the AVIFile library and decrement the reference count for the library
End Sub
BSP SkinMaker (v1.07) the one and only Skin Editor for BSplayer
BSP Definitions Manager (v1.02)
BS.Player's FAQ (by BSPeter) | Italian language file (v2.57 build 1051)
Reply With Quote

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20