1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-06 03:50:08 +02:00

add function to get duration

This commit is contained in:
B. Petersen 2017-11-22 21:51:46 +01:00
parent 19f3f5ea29
commit 336d4fe276
2 changed files with 22 additions and 0 deletions

View file

@ -424,6 +424,27 @@ cleanup:
}
/**
* Get duration of audios or videos. The duration is returned in milliseconds (ms).
* If the duration is unknown or if the associated file is no audio or video file,
* 0 is returned.
*
* @memberof mrmsg_t
*
* @param msg The message object.
*
* @return Duration in milliseconds, if applicable. 0 otherwise or if unknown.
*/
int mrmsg_get_duration(mrmsg_t* msg)
{
if( msg == NULL ) {
return 0;
}
return mrparam_get_int(msg->m_param, MRP_DURATION, 0);
}
/**
* Check if a padlock should be shown beside the message.
*