[Player-cvs] kit/android PlayerDriver.cpp, 1.10.2.26.2.7, 1.10.2.26.2.8
joeli at helixcommunity.org joeli at helixcommunity.orgUpdate of /cvsroot/player/kit/android
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv7618
Modified Files:
Tag: hxclient_3_6_2_atlas
PlayerDriver.cpp
Log Message:
fixed for CR: 12059
As for avi content, we don't support "fd://" prefix.
so we need convert it to "file://" prefix.
Index: PlayerDriver.cpp
===================================================================
RCS file: /cvsroot/player/kit/android/Attic/PlayerDriver.cpp,v
retrieving revision 1.10.2.26.2.7
retrieving revision 1.10.2.26.2.8
diff -u -d -r1.10.2.26.2.7 -r1.10.2.26.2.8
--- PlayerDriver.cpp 14 Oct 2010 07:11:15 -0000 1.10.2.26.2.7
+++ PlayerDriver.cpp 18 Nov 2010 09:21:14 -0000 1.10.2.26.2.8
@@ -1094,6 +1094,27 @@
status_t HelixPlayer::setDataSource(int fd, int64_t offset, int64_t length)
{
+ // FIXME: We can't figure out why fdbufdataf doesn't work with
+ // AVI file under Android, temporarily hack to use file:// for AVI
+ // file extension, the rest of file types continue with fd:// URL scheme
+ char pszName1[MAX_PATH];
+ char pszName2[MAX_PATH];
+ snprintf(pszName1, MAX_PATH-1, "/proc/%d/fd/%d", getpid(), fd);
+ INT32 lLen = readlink(pszName1, pszName2, MAX_PATH-1);
+ pszName2[lLen] = '\0';
+ const char *pszExt = strrchr(pszName2, '.');
+ if (pszExt)
+ {
+ pszExt++;
+ if (stricmp(pszExt, "avi")==0)
+ {
+ if (offset != 0) return BAD_VALUE;
+ snprintf(pszName1, MAX_PATH-1, "file://%s", pszName2);
+ LOGI("convert URL to %s", pszName1);
+ return m_PlayerDriver->enqueueCommand(new PlayerSetDataSource(pszName1,0,0));
+ }
+ }
+
m_Duration = 0;
m_VideoWidth = 0;
m_VideoHeight = 0;