#ifdef __MMFILE_FFMPEG_V085__
if (pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
#else
- if ( pFormatCtx->streams[i]->codec->codec_type == AV_CODEC_TYPE_VIDEO) {
+ if (pFormatCtx->streams[i]->codec->codec_type == AV_CODEC_TYPE_VIDEO) {
#endif
if (formatContext->videoStreamId == -1) {
videoStream = mmfile_malloc(sizeof(MMFileFormatStream));
#ifdef __MMFILE_FFMPEG_V085__
else if (pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
#else
- else if ( pFormatCtx->streams[i]->codec->codec_type == AV_CODEC_TYPE_AUDIO ) {
+ else if (pFormatCtx->streams[i]->codec->codec_type == AV_CODEC_TYPE_AUDIO) {
#endif
if (formatContext->audioStreamId == -1) {
audioStream = mmfile_malloc(sizeof(MMFileFormatStream));
#endif
formatContext->privateFormatData = NULL;
}
-
}
return MMFILE_FORMAT_SUCCESS;
debug_msg(" flags: 0x%08X, %s\n", pkt->flags, (pkt->flags & PKT_FLAG_KEY) ? "Keyframe" : "_");
#endif
debug_msg(" duration: %d\n", pkt->duration);
- debug_msg(" destruct: %p\n", pkt->destruct);
- debug_msg(" priv: %p\n", pkt->priv);
+ /*debug_msg(" destruct: %p\n", pkt->destruct);*/
+ /*debug_msg(" priv: %p\n", pkt->priv);*/
debug_msg(" pos: %lld\n", pkt->pos);
debug_msg(" convergence_duration: %lld\n", pkt->convergence_duration);
debug_msg("-------------------------------\n");
case AV_CODEC_ID_RV40: /* RealVideo 4 */
ret_codecid = MM_VIDEO_CODEC_REAL;
break;
+#ifdef __MMFILE_LIBAV_VERSION__
case AV_CODEC_ID_HEVC:
ret_codecid = MM_VIDEO_CODEC_MPEG4;
break;
+#endif
default:
ret_codecid = MM_VIDEO_CODEC_NONE;
break;
case MM_FILE_FORMAT_3GP:
case MM_FILE_FORMAT_MP4: {
if (skip_index == MM_FILE_FORMAT_QT || skip_index == MM_FILE_FORMAT_3GP || skip_index == MM_FILE_FORMAT_MP4)
- goto FILE_FORMAT_FAIL;
+ break;
if (MMFileFormatIsValidMP4(fp, NULL)) {
*formatEnum = MM_FILE_FORMAT_3GP;
case MM_FILE_FORMAT_WMA:
case MM_FILE_FORMAT_WMV: {
if (skip_index == MM_FILE_FORMAT_ASF || skip_index == MM_FILE_FORMAT_WMA || skip_index == MM_FILE_FORMAT_WMV)
- goto FILE_FORMAT_FAIL;
+ break;
if (MMFileFormatIsValidASF(fp, NULL)) {
*formatEnum = MM_FILE_FORMAT_ASF;
case MM_FILE_FORMAT_DIVX:
case MM_FILE_FORMAT_AVI: {
if (skip_index == MM_FILE_FORMAT_DIVX || skip_index == MM_FILE_FORMAT_AVI)
- goto FILE_FORMAT_FAIL;
+ break;
if (MMFileFormatIsValidAVI(fp, NULL)) {
*formatEnum = MM_FILE_FORMAT_AVI;
case MM_FILE_FORMAT_JPG:
default: {
debug_error("error: invaild format enum[%d]\n", index);
- goto FILE_FORMAT_FAIL;
break;
}
}
unsigned long v2numOfFrames = 0;
unsigned long curPos = 0;
char CompTmp[4];
- char *pExtContent = NULL;
+ unsigned char *pExtContent = NULL;
unsigned long purelyFramelen = 0;
unsigned int encodingOffSet = 0;
int inx = 0, realCpyFrameNum = 0,
if (encodingOffSet < purelyFramelen) {
realCpyFrameNum = purelyFramelen - encodingOffSet;
pExtContent = mmfile_malloc(realCpyFrameNum + 3);
+
+ if (pExtContent == NULL) {
+ debug_error("out of memory for pExtContent\n");
+ continue;
+ }
+
memset(pExtContent, '\0', realCpyFrameNum + 3);
memcpy(pExtContent, &buffer[curPos - purelyFramelen + encodingOffSet], purelyFramelen - encodingOffSet);
int cur_pos = 0;
int dis_len = 0;
int new_dis_len = 0;
- char jpg_sign[3] = {0xff, 0xd8, 0xff};
- char png_sign[8] = {0x80, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};
+ unsigned char jpg_sign[3] = {0xff, 0xd8, 0xff};
+ unsigned char png_sign[8] = {0x80, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};
char *tmp_desc = NULL;
while (1) {
int cur_pos = 0;
int dis_len = 0;
int new_dis_len = 0;
- char jpg_sign[3] = {0xff, 0xd8, 0xff};
- char png_sign[8] = {0x80, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};
+ unsigned char jpg_sign[3] = {0xff, 0xd8, 0xff};
+ unsigned char png_sign[8] = {0x80, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};
char *tmp_desc = NULL;
while (1) {
if (textEncodingType == AV_ID3V2_UTF8) {
pInfo->pUnsyncLyrics = mmfile_malloc(realCpyFrameNum + 2); /*Ignore NULL char for UTF16 */
- memset(pInfo->pUnsyncLyrics, 0, (realCpyFrameNum + 2));
- memcpy(pInfo->pUnsyncLyrics, pExtContent + tmp, realCpyFrameNum);
- pInfo->pUnsyncLyrics[realCpyFrameNum] = '\0';
- /*string copy with '\0'*/
- pInfo->unsynclyricsLen = realCpyFrameNum;
- _STRNCPY_EX(pInfo->pUnsyncLyrics, pExtContent, pInfo->unsynclyricsLen);
+
+ if (pInfo->pUnsyncLyrics != NULL) {
+ memset(pInfo->pUnsyncLyrics, 0, (realCpyFrameNum + 2));
+ memcpy(pInfo->pUnsyncLyrics, pExtContent + tmp, realCpyFrameNum);
+ pInfo->pUnsyncLyrics[realCpyFrameNum] = '\0';
+ /*string copy with '\0'*/
+ pInfo->unsynclyricsLen = realCpyFrameNum;
+ _STRNCPY_EX(pInfo->pUnsyncLyrics, pExtContent, pInfo->unsynclyricsLen);
+ } else {
+ debug_error("out of memoryu for SyncLyrics\n");
+ }
} else {
pInfo->pUnsyncLyrics = mmfile_string_convert((const char *)&pExtContent[tmp], realCpyFrameNum, "UTF-8", charset_array[textEncodingType], NULL, (unsigned int *)&pInfo->unsynclyricsLen);
}
int cur_pos = 0;
int dis_len = 0;
int new_dis_len = 0;
- char jpg_sign[3] = {0xff, 0xd8, 0xff};
- char png_sign[8] = {0x80, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};
+ unsigned char jpg_sign[3] = {0xff, 0xd8, 0xff};
+ unsigned char png_sign[8] = {0x80, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};
char *tmp_desc = NULL;
while (1) {