@@ -544,6 +544,17 @@ static int mp_property_filename(void *ctx, struct m_property *prop,
544544 return r ;
545545}
546546
547+ static int mp_property_env (void * ctx , struct m_property * prop ,
548+ int action , void * arg )
549+ {
550+ if (action == M_PROPERTY_KEY_ACTION ) {
551+ struct m_property_action_arg * ka = arg ;
552+ char * val = getenv (ka -> key );
553+ return m_property_strdup_ro (ka -> action , ka -> arg , val );
554+ }
555+ return M_PROPERTY_NOT_IMPLEMENTED ;
556+ }
557+
547558static int mp_property_stream_open_filename (void * ctx , struct m_property * prop ,
548559 int action , void * arg )
549560{
@@ -4387,6 +4398,7 @@ static const struct m_property mp_properties_base[] = {
43874398 {"video-speed-correction" , mp_property_av_speed_correction , .priv = "v" },
43884399 {"display-sync-active" , mp_property_display_sync_active },
43894400 {"filename" , mp_property_filename },
4401+ {"env" , mp_property_env },
43904402 {"stream-open-filename" , mp_property_stream_open_filename },
43914403 {"file-size" , mp_property_file_size },
43924404 {"path" , mp_property_path },
0 commit comments