Mercurial > mplayer.hg
diff m_property.c @ 23394:d4e8613ddc95
Make all the info available via the metadata API available via properties.
author | albeu |
---|---|
date | Tue, 29 May 2007 22:14:41 +0000 |
parents | a5e55cb59bbc |
children | 0ff039835f0f |
line wrap: on
line diff
--- a/m_property.c Tue May 29 21:49:39 2007 +0000 +++ b/m_property.c Tue May 29 22:14:41 2007 +0000 @@ -331,3 +331,15 @@ } return M_PROPERTY_NOT_IMPLEMENTED; } + +int m_property_bitrate(m_option_t* prop,int action,void* arg,int rate) { + switch(action) { + case M_PROPERTY_PRINT: + if (!arg) + return M_PROPERTY_ERROR; + *(char**)arg = malloc (16); + sprintf(*(char**)arg, "%d kbps", rate*8/1000); + return M_PROPERTY_OK; + } + return m_property_int_ro(prop, action, arg, rate); +}