AVCodec *pVideoCodec = NULL;
AVFrame *pFrame = NULL;
AVPacket packet;
+ AVStream *pStream = NULL;
+ double duration = 0;
+ int64_t tmpPts = 0;
+#ifdef __MMFILE_TEST_MODE__
+ int idx = 0;
+#endif
/* Retrieve stream information */
if (avformat_find_stream_info(pFormatCtx, NULL) < 0) {
}
/* Seeking */
- AVStream *pStream = pFormatCtx->streams[videoStream];
- double duration = (double) pFormatCtx->duration / AV_TIME_BASE;
+ pStream = pFormatCtx->streams[videoStream];
+ duration = (double) pFormatCtx->duration / AV_TIME_BASE;
#if 0
if (duration <= 0) {
double tmpDuration = 0.0;
av_seek_frame(pFormatCtx, -1, pos, AVSEEK_FLAG_BACKWARD);
/* Reading Data */
- int64_t tmpPts = 0;
-#ifdef __MMFILE_TEST_MODE__
- int idx = 0;
-#endif
av_init_packet(&packet);
switch (eTag) {
case eMMFILE_3GP_TAG_TITLE: {
if (!formatContext->title) {
- formatContext->title = temp_text;
+ formatContext->title = g_strdup(temp_text);
}
break;
}
case eMMFILE_3GP_TAG_CAPTION: {
if (!formatContext->description) {
- formatContext->description = temp_text;
+ formatContext->description = g_strdup(temp_text);
}
break;
}
case eMMFILE_3GP_TAG_COPYRIGHT: {
if (!formatContext->copyright) {
- formatContext->copyright = temp_text;
+ formatContext->copyright = g_strdup(temp_text);
}
break;
}
case eMMFILE_3GP_TAG_PERFORMER: {
if (!formatContext->artist) {
- formatContext->artist = temp_text;
+ formatContext->artist = g_strdup(temp_text);
}
break;
}
case eMMFILE_3GP_TAG_AUTHOR: {
if (!formatContext->author) {
- formatContext->author = temp_text;
+ formatContext->author = g_strdup(temp_text);
}
break;
}
case eMMFILE_3GP_TAG_GENRE: {
if (!formatContext->genre) {
- formatContext->genre = temp_text;
+ formatContext->genre = g_strdup(temp_text);
}
break;
}
texttag.text = NULL;
mmfile_seek(fp, basic_header->start_offset + basic_header->size, SEEK_SET);
+ _FREE_EX(temp_text);
+
return MMFILE_UTIL_SUCCESS;
exception:
temp_text = mmfile_strdup((const char *)albumbox.albumtile);
}
- if (!formatContext->album) {
+ if (!formatContext->album)
formatContext->album = temp_text;
- }
+ else
+ _FREE_EX(temp_text);
debug_msg(RELEASE, "formatContext->album=%s, strlen=%d\n", formatContext->album, strlen(formatContext->album));
}
int readed;
unsigned long long chunk_size = 0;
long long moov_end = 0;
+ MMFILE_MP4_BASIC_BOX_HEADER basic_header = {0, };
+ int junk_counter = 0;
ret = mmfile_open(&fp, formatContext->uriFileName, MMFILE_RDONLY);
if (ret == MMFILE_UTIL_FAIL) {
goto exit;
}
- MMFILE_MP4_BASIC_BOX_HEADER basic_header = {0, };
basic_header.start_offset = mmfile_tell(fp);
- int junk_counter = 0;
if (g_junk_counter_limit == 0)
g_junk_counter_limit = GetJunkCounterLimit();
debug_msg(RELEASE, "this text string(%s) encoded by ISO-8859-1 encodingOffSet(%d)\n", CompTmp, encodingOffSet);
}
+ if (pExtContent) _FREE_EX(pExtContent);
+
if (encodingOffSet < purelyFramelen) {
realCpyFrameNum = purelyFramelen - encodingOffSet;
pExtContent = mmfile_malloc(realCpyFrameNum + 3);
}
}
+ if (pExtContent) _FREE_EX(pExtContent);
+
if (encodingOffSet < purelyFramelen) {
realCpyFrameNum = purelyFramelen - encodingOffSet;
pExtContent = mmfile_malloc(realCpyFrameNum + 3);