int mmfile_format_read_tag_ffmpg(MMFileFormatContext *formatContext)
{
AVFormatContext *pFormatCtx = NULL;
+ unsigned int idx = 0;
- if (NULL == formatContext || NULL == formatContext->privateFormatData) {
+ if (!formatContext || !formatContext->privateFormatData) {
debug_error(DEBUG, "invalid param\n");
return MMFILE_FORMAT_FAIL;
}
- pFormatCtx = formatContext->privateFormatData;
- if (!pFormatCtx) {
- debug_warning(DEBUG, "No format information");
- return MMFILE_FORMAT_SUCCESS;
- }
-
if (formatContext->formatType == MM_FILE_FORMAT_3GP || formatContext->formatType == MM_FILE_FORMAT_MP4) {
MMFileUtilGetMetaDataFromMP4(formatContext);
}
MMFileUtilGetMetaDataFromMKV(formatContext);
}
- /*metadata extracted by ffmpeg*/
- unsigned int idx = 0;
+ pFormatCtx = formatContext->privateFormatData;
+ /*metadata extracted by ffmpeg*/
for (idx = 0; idx < pFormatCtx->nb_streams + 1; idx++) {
AVDictionary *metainfo = NULL;
AVStream *st = NULL;