comparison command.c @ 23396:8412921b363c

Add PRINT to the samplerate property.
author albeu
date Wed, 30 May 2007 06:53:06 +0000
parents d4e8613ddc95
children 07741c30e64c
comparison
equal deleted inserted replaced
23395:0ff039835f0f 23396:8412921b363c
497 static int mp_property_samplerate(m_option_t * prop, int action, void *arg, 497 static int mp_property_samplerate(m_option_t * prop, int action, void *arg,
498 MPContext * mpctx) 498 MPContext * mpctx)
499 { 499 {
500 if (!mpctx->sh_audio) 500 if (!mpctx->sh_audio)
501 return M_PROPERTY_UNAVAILABLE; 501 return M_PROPERTY_UNAVAILABLE;
502 switch(action) {
503 case M_PROPERTY_PRINT:
504 if(!arg) return M_PROPERTY_ERROR;
505 *(char**)arg = malloc(16);
506 sprintf(*(char**)arg,"%d kHz",mpctx->sh_audio->samplerate/1000);
507 return M_PROPERTY_OK;
508 }
502 return m_property_int_ro(prop, action, arg, mpctx->sh_audio->samplerate); 509 return m_property_int_ro(prop, action, arg, mpctx->sh_audio->samplerate);
503 } 510 }
504 511
505 /// Number of channels (RO) 512 /// Number of channels (RO)
506 static int mp_property_channels(m_option_t * prop, int action, void *arg, 513 static int mp_property_channels(m_option_t * prop, int action, void *arg,