spark: implement cVideo::SetSyncMode()

inspired by evolux, but much simpler
This commit is contained in:
Stefan Seyfried
2012-06-08 22:30:11 +02:00
parent f0f295efa1
commit 9e075bf190

View File

@@ -561,28 +561,20 @@ void cVideo::getPictureInfo(int &width, int &height, int &rate)
lt_debug("%s: rate: %d, width: %d height: %d\n", __func__, rate, width, height); lt_debug("%s: rate: %d, width: %d height: %d\n", __func__, rate, width, height);
} }
void cVideo::SetSyncMode(AVSYNC_TYPE Mode) void cVideo::SetSyncMode(AVSYNC_TYPE mode)
{ {
lt_debug("%s %d\n", __FUNCTION__, Mode); lt_debug("%s %d\n", __func__, mode);
/* /*
* { 0, LOCALE_OPTIONS_OFF }, * { 0, LOCALE_OPTIONS_OFF },
* { 1, LOCALE_OPTIONS_ON }, * { 1, LOCALE_OPTIONS_ON },
* { 2, LOCALE_AUDIOMENU_AVSYNC_AM } * { 2, LOCALE_AUDIOMENU_AVSYNC_AM }
*/ */
#if 0 const char *apply[] = { "disapply", "apply" };
switch(Mode) const char *clock[] = { "video", "audio" };
{ const char *a = apply[mode > 0]; /* mode == 1 or mode == 2 -> "apply" */
case 0: const char *c = clock[mode > 1]; /* mode == 2 -> "audio" */
ioctl(fd, MPEG_VID_SYNC_OFF); proc_put("/proc/stb/stream/policy/AV_SYNC", a, strlen(a));
break; proc_put("/proc/stb/stream/policy/MASTER_CLOCK", c, strlen(c));
case 1:
ioctl(fd, MPEG_VID_SYNC_ON, VID_SYNC_VID);
break;
default:
ioctl(fd, MPEG_VID_SYNC_ON, VID_SYNC_AUD);
break;
}
#endif
}; };
int cVideo::SetStreamType(VIDEO_FORMAT type) int cVideo::SetStreamType(VIDEO_FORMAT type)