I have been assigned a project to work in a software which works like MATLAB.
It has a feature videosync which would sync a video and play it in windows media player while plotting. But it only plays MP3,WMV,MPG,AVI files as they dont need codecs. It doesnot play mp4 files.
The windows media player in my desktop however plays mp4 files. Which I have the necessary codecs in the system.
So, can anyone reply me with a code which I can update in the DLL of the software that would allow me to do play them.
Below is a snippet of my code from videosync.c
#include <stdio.h>
#include <string.h>
#include "wavevars.h"
#include <windows.h>
long __declspec(dllimport) __stdcall mciSendStringA(char *, char *, int ,int *);
int OpenMediaFile(int argc, char ** argv)
{
char strCommand[200] = "", **strFile;
int zero = 0;
if (argc != 1)
{
printf("Wrong # of parameters (%d) for OpenMediaFile.\n",argc);
return -1;
}
strFile = ((char ***)argv[0]);
strcpy_s(strCommand, 200, "Open \"");
strcat_s(strCommand, 200, strFile[0]);
strcat_s(strCommand, 200, "\" alias MediaFile");
mciSendStringA(strCommand, "", 0, &zero);
return 1;
int PlayMediaFile(int argc, char ** argv)
{
char strCommand[200] = "";
int zero = 0;
if (argc != 0)
{
printf("Wrong # of parameters (%d) for PlayMediaFile.\n",argc);
return -1;
}
strcpy_s(strCommand, 200, " Play MediaFile");
mciSendStringA(strCommand, "", 0, &zero);
return 1;
}
<pre lang="text"><pre lang="text">