Jump to content

COM PlayFile


majstang

Recommended Posts

Seems to work as long as the files passed to function doesn't contain any Unicode special chars in file name.

; Files with special Unicode chars renders this OSD message = Cannot render Mediafile/Input pin, error: 0x80040216
FileToPlay := "F:\TV\Recording Service\20170429_23-54-01_Kanal 5_Ender’s Game - ★★★★★★★☆☆☆.ts"
FileToPlay := "F:\TV\Recording Service\20170505_19-59-01_Discovery Channel_Gold Rush  Alaska - S01E03 - “Hypothermia”.ts"
; These files play OK  
FileToPlay := "F:\TV\Recording Service\20170502_19-29-04_SVT2 HD_Hundra procent bonde - S02E06.ts"
FileToPlay := "F:\Edited Recordings\20170305_01-24-01_TV8_Sea of Love -.ts"
iDVBViewer.PlayFile(FileToPlay)

 

  • Like 1
Link to comment

I can't see why, because the implementation

procedure TDVBViewer.PlayFile(const Filename: WideString);
begin
  frmMain.LoadMediafile(Filename, rtSettings);
end;

and drag & drop of files into the main window are both using LoadMediaFile. Drag & drop works here with filenames containing Unicode special characters.

 

P.S. No, there is definitely something wrong because here DVBViewer always uses the LAV Source Filter for playing a dragged & dropped TS file with Unicode special characters. It should be the DVBViewer Filter. Let's see what the debugger reveals...

Link to comment
Quote

Change Log DVBViewer Pro 6.0.2

  • Fix: File Playback: File playback with the DVBViewer Filter did not work if the filename contained  characters that were not available in the local character set.

Hmm...surprisingly enough I still cannot play files with special chars through COM.  Cannot render Mediafile/Input pin, error: has changed from 0x80040216 to 0x80004005. 

Link to comment

 

4 hours ago, Griga said:

Does it work with drag & drop to the main window?

Yes, that is no problem.

 

Hmm...this is strange:unsure: Invoking COM with AutoHotkey or VBScript like this brings out the problem.

VBScript:

Set iDVBViewer = GetObject(, "DVBViewerServer.DVBViewer")
iDVBViewer.PlayFile("F:\Edited Recordings\20170305_01-24-01_TV8_Sea of Love -.ts")                   'This works
WScript.Sleep 7000
iDVBViewer.PlayFile("F:\TV\Recording Service\20170512_23-59-02_TV8_Åskhjärta - ★★★★★★★☆☆☆.ts")  'Cannot render Mediafile/Input pin, error:  0x80004005.undeifined error

AHK:

iDVBViewer := ComObjActive("DVBViewerServer.DVBViewer")
iDVBViewer.PlayFile("F:\Edited Recordings\20170305_01-24-01_TV8_Sea of Love -.ts")                  ; This works
Sleep 7000
iDVBViewer.PlayFile("F:\TV\Recording Service\20170512_23-59-02_TV8_Åskhjärta - ★★★★★★★☆☆☆.ts") ; Cannot render Mediafile/Input pin, error:  0x80004005.undeifined error

The funny part is it suddenly works if using the thumbnailed app as a drop target (which is how Im gonna utilize it) and executing the same code as above:

; ----------------------------------------------------------------------------------------------------------------------------------
;---Drag and drop for the DVBViewer thumbnail
; ----------------------------------------------------------------------------------------------------------------------------------
IDropTargetOnDrop_THUMB(TargetObject, pDataObj, KeyState, X, Y, DropEffect) {
   Global iDVBViewer
   ; Get the dropped files                                   
   IDataObject_GetDroppedFiles(pDataObj, DroppedFiles)    
    For Index, File In DroppedFiles
      iDVBViewer.PlayFile(File)
   Return 0
}

 

 

Edited by majstang
Link to comment

Looks like the filename is converted to a one-byte (local) character set in between. DVBViewer doesn't do it (see implementation above - it's WideString = UTF-16 throughout). Seems there is quite a lot happening in the COM & Script background...

Link to comment
1 hour ago, Griga said:

Looks like the filename is converted to a one-byte (local) character set in between. DVBViewer doesn't do it (see implementation above - it's WideString = UTF-16 throughout). Seems there is quite a lot happening in the COM & Script background...

Ah, these COM IDispatch interface helper functions which are handling conversions seems to do some funny stuff...throwing "curve-balls" trickier than the next;) Why its not doing that conversion in my last (working) code sample is the question...

Edited by majstang
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...